You could use a HTML parser to find tags and text, and do a replacement on the text while writing out everything you find. This is the cleanest thing to do.
Alternatively, use a two-level approach, first find tags, then replace the $a in the parts of the input that were skipped between matches on tags.
Hope this helps, -gjb-
In reply to Re: Replace characters not in html tags
by gjb
in thread Replace characters not in html tags
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |