Logically, $1 can be anything that exists at the end of the string because (?:(\d+)|::)* matches a zero-length string. So whatever is in (\d+) is irrelevant.(this is wrong)
I thought the regex engine had been "fixed" to set inner captured matches to undef when outer matches were zero length, but I still wouldn't depend on it.(this doesn't apply here)
Update: The uncapturing parens along with the "*" do match multiple digits, but the inner parens match many times, and only the last thing is captured.
In reply to Re: Regular Expressions
by runrig
in thread Regular Expressions
by y8
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |