$from = '[hello]'; $to = '{goodbye}'; $string =~ s/\Q$from\E/$to/; # or $safe_from = quotemeta $from; $string =~ s/$safe_from/$to/;
In reply to Re: Regular Expressions and Variables
by japhy
in thread Regular Expressions and Variables
by skazat
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |