Flatten capture numbering across alternatives
Normally, alternation inside a group still gives each alternative its own group numbers if they have inner groups. (a(b)c|d(e)f) has groups 1 (full), 2 (b), and 3 (e). The 'b' and 'e' get separate numbers even though they're alternatives.
Branch reset groups (?|...) reset the numbering for each alternative. (?|a(b)c|d(e)f) — group 1 is 'b' OR 'e', whichever matched. Cleaner if you want "the inner part of whichever branch matched."
Use case
When you have N alternative patterns and want a single capture slot for the meaningful part of each. Without branch reset, you'd have N capture slots, only one populated, and you'd have to walk them to find the non-None one.
Engine support
PCRE and Perl. Python's third-party regex module. Not in built-in re, JavaScript, .NET, or Go.
The portable workaround
Without branch reset, just use named groups with the same name in different alternatives. PCRE allows this; Python's regex module too. Built-in re rejects duplicate names. So if you need this and you're stuck on built-in re, post-process: pick the first non-None group.