ctgIT has asked for the wisdom of the Perl Monks concerning the following question:
$str = "(<ref links=\" cit314-1 cit314-2 cit314-3 cit314-4 cit314-5\"/ +>)"; if( $str =~ s/<ref links=\"(.*?)\"(.*?)\/>/<ref links=\"$1\"$2>(?{ pri +nt $1 })<\/ref>/ ){ print "Match was found." . "\n"; } print $str . "\n";
Match was found. (<ref links=" cit314-1 cit314-2 cit314-3 cit314-4 cit314-5">(?{ print + cit314-1 cit314-2 cit314-3 cit314-4 cit314-5 })</ref>)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: regex (?{CODE}) question
by elusion (Curate) on Aug 01, 2002 at 19:19 UTC | |
by Ferret (Scribe) on Aug 01, 2002 at 19:34 UTC | |
by elusion (Curate) on Aug 01, 2002 at 19:37 UTC | |
by ctgIT (Initiate) on Aug 01, 2002 at 19:53 UTC | |
by elusion (Curate) on Aug 01, 2002 at 19:59 UTC | |
|
Re: regex (?{CODE}) question
by rsteinke (Scribe) on Aug 01, 2002 at 19:15 UTC |