For clarity, the regex expands to the equivalent of:
re = %r{
(?:
(?<thing>.+)
){0}
(?<thing>.+)
}
So, yes, (?<thing>.+) did match. It is just that the first instance didn't match. In Perl, %+ only records the captures of the first instance.
| [reply] [Watch: Dir/Any] [d/l] [select] |
No, you misread. \g<thing> in Ruby-1.9's oniguruma works like (?&thing) in perl 5.10. It's a subroutine call. The grammar section (?: ... ){0} creates the subroutines and I just call an entry point later.
| [reply] [Watch: Dir/Any] [d/l] [select] |
| [reply] [Watch: Dir/Any] |
I read the idea (?<name>...){0} in the Oniguruma documentation but it was applicable to Perl too. In Perl-5.10 implementation, (?:...){0} leaves active elements like regexp routines handy in the regexp. Really, that seems to work just fine. Anyway, it's pretty clear I'm likely doing something Yves never intended when he added (?&name) support.
| [reply] [Watch: Dir/Any] [d/l] [select] |