in reply to Regex: succeeds, but parens don't collect...
Such a regexp will always match, and always at the beginning of the string. In your case, it matches the empty string. So, the optional still matches, but it doesn't match what you think it will match.
Why you have the outer (?: )? construct anyway isn't clear to me.
|
|---|