in reply to Re: Greedy modifier found to be working non-greedy in a named group
in thread Greedy modifier found to be working non-greedy in a named group
the explanation of leftmost first and then longest will be valid even if I didn't use named groups. So, this behavior is generic.
Yes, perlre says:
In Perl the groups are numbered sequentially regardless of being named or not. Thus in the pattern$+{foo} will be the same as $2, and $3 will contain 'z'/(x)(?<foo>y)(z)/
And the description of (?|pattern) says:
Named captures are implemented as being aliases to numbered groups holding the captures
Also, I remember finding the description of the left-to-right operation of the regex engine in the Camel quite enlightening.
|
|---|