Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
5.10 regexes with subpatternsby renormalist (Sexton) |
on Aug 08, 2007 at 21:42 UTC ( [id://631420]=perlquestion: print w/replies, xml ) | Need Help?? |
renormalist has asked for the wisdom of the Perl Monks concerning the following question:
Hi!
I try to use the new advanced 5.9.5 regex features. I have problems to understand the usefulness of DEFINE'ing sub-patterns, because inside of them another feature, capture buffers via %+, does not work. This would make DEFINE less fun, because structuring the regex this way and at the same time loosing the ability to reach captured parts seems quite antagonistic. So I suspect, I'm doing something wrong. Please see the following two examples. How can I access the matched animal in the second example? Example 1:Example 2:
"man perlre" seems to confirm me:
But I hope there is a way to solve it somehow. Thanks.
Back to
Seekers of Perl Wisdom
|
|