RegexEditor.dev Logo

Regex Editor & Tester

Build, test, and debug regular expressions

b|aAlternation is commutative: b|a = a|bAlternationFormal RE✨ Emoji Combos

Unlike concatenation, alternation is commutative. L(a|b) = L(b|a). Order of alternatives never affects the accepted language.

✓ Accepts
ab
✗ Rejects
εabbac
Loading editor…