But for your specific question, if %replace has your translation of key to value then you can do this:
my $match = join "|", map {quotemeta($_)} keys %replace; $str = s/<--($match)-->/$replace{$1}/g;
In reply to RE (tilly) 1: REGEX: muliple search and replace
by tilly
in thread REGEX: muliple search and replace
by whahoo
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |