RegexEditor.dev Logo

Regex Editor & Tester

Build, test, and debug regular expressions

(a|b)*a(a|b)(a|b)(a|b)*a(a|b)(a|b) — 3rd from end is aClassic ProblemsFormal RE✨ Emoji Combos

Classic NFA exercise: guess nondeterministically when you're 3 from the end. The minimal DFA has 8 states (subset construction on 4-state NFA).

✓ Accepts
aaaaababaabbbaabbabb
✗ Rejects
εaabbbabbb
Loading editor…