'2c3w' cannot be matched only by the second parentheses; the first parentheses must match as well, otherwise the entire match would fail.Incorrect. You are using alternation so only one of the alternatives has to match for the entire match to be successful.
The alternation is repeated with the + so that multiple branches can match. And the regex is anchored with an '^' so in order for the '3w' to match, the '2c' must match first. Not at the same time, but they both do match on the same string.
Adding a '$' anchor does not change the symptoms, and was left out of the example.
In reply to Re^4: Leaking Regex Captures
by SuicideJunkie
in thread Leaking Regex Captures
by SuicideJunkie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |