It failed if there was a number directly after the token, resulting in $12345, where $1 was needed. Fixed by using ${x}
also made sure that newlines within the html replacement are not replaced with <br />.
git-svn-id: file:///svn/phpbb/trunk@6391 89ea8834-ac86-4346-8a33-228a782c2dd0