to replace $a with $b only in data not enclosed in tags you need/>[^<]*$a/s;
s/(>[^<]*)$a/$1$b/sg;
In reply to Re: Replace characters not in html tags
by dingus
in thread Replace characters not in html tags
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |