Depends on your amitiousness.
Warning - untested. I know I've used code similar to this in the past with a limited amount of success. (i.e., it worked for me for what I needed it to work for, and this is not a cut&paste job of that code.)$regexp = qr/a(b+)c/; $subst = 'c$1a'; my @a = $string =~ $regexp; $subst =~ s/\$(\d)/$a[$1-1]/ge; $string =~ s/$regexp/$subst/;
In reply to Re^2: Exec'ing a regex stored in a scalar variable
by Tanktalus
in thread Exec'ing a regex stored in a scalar variable
by brycen
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |