RegexEditor.dev Logo

Regex Editor & Tester

Build, test, and debug regular expressions

a(a|b)*a|b(a|b)*b|a|bStarts and ends with the same characterClassic ProblemsFormal RE✨ Emoji Combos

Length-1 strings trivially satisfy this. For length ≥ 2, the first and last characters must match.

✓ Accepts
abaabbababababba
✗ Rejects
abbaaabbbaε
Loading editor…