zusuki-san has asked for the wisdom of the Perl Monks concerning the following question:
while ($content =~ m/(<textarea.*textarea>)/sg) { my $match = $&; my $varmatch; print "match: before ..... $match\n"; if( $match =~ m/(<%=.*?%>)/sg){ $varmatch = $1; print "varmatch: $varmatch\n"; pos $match ; #cut var tag $match=~ s/$varmatch//g; print "match: after .... $match\n"; $match=~ s/textarea/testinsert$varmatch/g; print "match: after testinsert .... $match\n"; ...program continues here program output: ---------- perl ---------- varmatch: <%=foo::doSomething%> match: before .... <textarea class="FolderTxtArea" name="blah"><%=foo: +:doSomething%></textarea> match: after .... <textarea class="FolderTxtArea" name="blah"><%=foo: +:doSomething%></textarea> match: after testinsert .... <testinsert<%=foo::doSomething%> ...
|
|---|