in reply to regex (?{CODE}) question
Notice I also didn't escape the quotes -- this isn't necessary and, I think, it makes things look a little messier.$str = "(<ref links=\" cit314-1 cit314-2 cit314-3 cit314-4 cit314-5\"/ +>)"; if( $str =~ s/<ref links="(.*?)"(.*?)\/>(?{ print $1, "\n" })/<ref lin +ks="$1"$2><\/ref>/ ){ print "Match was found." . "\n"; } print $str . "\n";
elusion : http://matt.diephouse.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: regex (?{CODE}) question
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 |