in reply to extracting regex into, and interpolating, variable
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;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: extracting regex into, and interpolating, variable
by zusuki-san (Initiate) on Oct 23, 2002 at 14:41 UTC | |
by roik (Scribe) on Oct 23, 2002 at 15:23 UTC |