in reply to Re: Re: Returning regexp pattern that was used to match
in thread Returning regexp pattern that was used to match
(?{ CODE }) will execute any perl code when the regex engine tries to match it. So for example:
It's documented in the perlre man page under 'Extended Patterns'.
Should print out 'Found a Bar'.my $string = "Bar"; $sting =~ /Foo(?{ print "Found a Foo\n" })|Bar(?{ print "Found a Bar\n +" })|Baz(?{ print "Found a Baz\n" })/;
It's documented in the perlre man page under 'Extended Patterns'.
In Section
Seekers of Perl Wisdom