$string2 =~ s/(?<!a)($greekReplace)/\\$1 /isg;
More info can be found in perlre and perlretut. If you want to encode abeta but not amu, you should swap your 'mu' entry in $greekReplace to (?<!a)mu.
In reply to Re: Regex question
by kennethk
in thread Regex question
by memnoch
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |