|
|
| We don't bite newbies here... much | |
| PerlMonks |
Conditional regexby 7stud (Deacon) |
| on Feb 17, 2013 at 18:22 UTC ( #1019182=perlquestion: print w/ replies, xml ) | Need Help?? |
|
7stud has asked for the
wisdom of the Perl Monks concerning the following question:
Dear Monks, If I use the construct (?(condition)yes-pattern) in a regex, and the condition is the execute-perl-code construct (?{1}), i.e. the condition is always true, the output is as expected:
But when I use the condition (?{pos() % 2 == 0}), I expect the same output, but I don't get it:
Three matches? Also, I notice the x modifier doesn't work with a conditional regex: That feels like a bug.
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||