use strict; my $line = qq(<textarea type="text" value="foo" name="text_message" /> + <%bar%> </p>); my $foo = "foo"; if ($line =~ /<textarea .+<(%.+%)>/) { my $bar = $1; $line =~ s/<textarea/<input/; $line =~ s/$bar/$foo/; print $line; } exit;
In reply to Re: extracting regex into, and interpolating, variable
by roik
in thread extracting regex into, and interpolating, variable
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |