in reply to Re: Advanced (or not) regular expression
in thread Advanced (or not) regular expression

Hmm, that first chunk of code won't compile. Here is an alternative solution:
use strict; use warnings; my $content = "my mom"; my $from = qr|my (mom)|; my $to = '"our ".$1'; $content =~ s/$from/$to/ee; print "$content\n";

-Mark