RegexEditor.dev Logo

Regex Editor & Tester

Build, test, and debug regular expressions

← Back to BlogFormal RE›vs Programming Regex41 / 44
(a|ε)bNo ? quantifier — use (r|ε)vs Programming RegexFormal RE✨ Emoji Combos

Programming regex: a?b. Formal RE: (a|ε)b. The ? quantifier is defined as r? ≡ (r|ε). Formal RE makes this explicit.

✓ Accepts
bab
✗ Rejects
εaabbaabb
Loading editor…