Please read the benchmark numbers.
Alternation is MUCH faster than looping over trivial regexes, except when you use captures inside the alternations.
In reply to Re^4: alternation in regexes: to use or to avoid?
by balker
in thread alternation in regexes: to use or to avoid?
by dk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |