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