Alternation has the lowest precedence
The | operator binds LOOSER than anything else in regex. Whatever comes before and after the pipe extends as far as it can — usually all the way to the nearest enclosing parentheses (or the start/end of the entire pattern).
So abc|xyz means 'abc' OR 'xyz' — not 'abc followed by either nothing or xyz.'
And a(bc|xy)z means 'a, then either bc or xy, then z.' The parentheses contain the alternation.
Multi-branch alternation
You can chain alternatives: red|green|blue|yellow matches any of the four colors. There's no special syntax — just keep adding pipes.
For more than 5-6 alternatives, consider whether a character class would work, or whether the alternatives have a common shape that could be expressed as a single pattern.
Empty alternatives
A pipe with nothing on one side — foo| or |foo — matches an empty string OR foo. Equivalent to foo? when wrapped: (foo|) matches the same as (foo)?. Some engines accept it, some don't. Don't rely on it.