About the Regular Expression Tester
The Regex Tester compiles JavaScript expression syntax, guards against zero-length global loops and reports matched text, indexes and capture groups. An optional replacement preview uses the same expression.
How to use the Regular Expression Tester
- Enter the pattern without surrounding slash delimiters.
- Add valid flags such as g, i, m, s, u or y.
- Test matches and inspect the optional replacement preview.
Practical tips
- Add the g flag to collect every match rather than only the first.
- Test hostile or very large input cautiously because some patterns can backtrack heavily.