in reply to Re: Game Nicknames to HTML
in thread Game Nicknames to HTML
Take care with that code, it produces wrong results for strings like '$$$sfoo'. Instead I recommend this.
s/\$\$/\$S/g; s/\$[iswnmgtz]//g; s/\$S/\$/g;
Or, to strip the three-hexit color codes as well,
s/\$\$/\$S/g; s/\$(?:[0-9a-fA-F]{3}|[g-z])//g; s/\$S/\$/g;
Update: I should have linked to Re: checking interpreted string for escapes versus literal backslashes?.
|
|---|