|
|
|
Your skill will accomplish what the force of many cannot |
|
| PerlMonks |
Re^2: Possessive sub-pattern with non-greedy content + recursion: WHY does this work??by Anonymous Monk |
| on Aug 04, 2025 at 19:39 UTC ( [id://11165953]=note: print w/replies, xml ) | Need Help?? |
|
simplifies to ^ Oh... I didn't understand the whole construct, then. Thanks! I guess "Possessive sub-pattern with non-greedy..., etc." can be stricken out from title. To be replaced with, start-of-string anchor and failure? Because, Match fails -- it's irrelevant But looks like it is. And, in parallel, comparing with look-ahead, which at 1st glance can be a simpler alternative (?):
Output:
Look-ahead misses some PD's for obvious reasons. But match success in case of recursion leads to omission of 2 PD's, too. Why? Converting "comment" to "fail" i.e. (F*) gives all nine PD's, visited exactly once each (with some disruption to "visit in reverse" order):
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||||