Regex Tester
Test regular expressions against a block of text and see every match, capture group, and index highlighted live.
🔒 Processed locally in your browser
Loading…
How to use
- Type or paste your regular expression pattern into the "Regular Expression" field (without the surrounding slashes).
- Toggle the i, m, and s flags as needed — the g (global) flag is always applied so every match is found, not just the first.
- Paste or type the text you want to test into the "Test String" box.
- Results update live: matches are highlighted in the preview, and each match's index and capture groups are listed below.
Features
- Highlights every match live in the test string as you type
- Lists each match's index, full matched text, and capture groups
- Toggle case-insensitive (i), multiline (m), and dot-all (s) flags
- Shows a clear inline error message for invalid patterns instead of crashing
- 100% client-side — your pattern and text never leave your browser
Frequently asked questions
Does my pattern or text get uploaded anywhere?
No. Regex Tester runs entirely in your browser using JavaScript's native RegExp engine — nothing is ever sent to a server.
Why can't I turn off the g (global) flag?
The global flag is required to find every match instead of stopping at the first one, which is what this tool is for. The i, m, and s flags remain fully toggleable.
What happens if I type an invalid pattern?
You'll see a clear error message explaining what's wrong (like an unbalanced parenthesis) instead of the tool crashing or showing a blank screen.
Does it support capture groups?
Yes. Each match in the list below shows its numbered capture groups, if the pattern has any. Groups that matched an empty string are labeled accordingly.
What regex flavor does this use?
It uses your browser's native JavaScript RegExp engine, so syntax matches standard JavaScript regular expressions rather than PCRE, Python's `re`, or other flavors.