Back to home

Regex Tester

Highlight matches live, inspect capture groups and test replacements

//g
flags
Test string
Matches
Enter a pattern and some text to start
Replace with
Replaced
—

FAQ

Why can a regex freeze the page?

Nested quantifiers like (a+)+ can backtrack catastrophically on long non-matching input. Matches here run in a Web Worker with a timeout, so the UI stays responsive.

What do the g, i and m flags mean?

g finds every match instead of the first; i ignores case; m makes ^ and $ match line boundaries rather than only the whole string.