Regex Tester
Build, test and debug JavaScript regular expressions in real time. Live highlighting, capture groups, replace preview. Supports lookbehind, named groups and Unicode.
Test string
Highlighted
Replace result
A real-time regex playground in your browser
Build and debug regular expressions interactively. As you type the pattern, the test string is re-evaluated and matches are highlighted instantly. Capture groups (both numbered and named) show up in a side panel with their values for every match. No round-trip to a server, no signup, nothing tracked.
Native JavaScript regex flavor
We use the browser's own RegExp engine, which means the patterns you test here
will behave exactly the same in your JavaScript code. Modern features are all
supported: lookbehind (?<=...), named groups
(?<name>...), Unicode property escapes \p{...},
and the s (dotall) flag.
Replace mode
Toggle replace mode to preview a regex-based substitution. The replacement supports all the
standard $ tokens: $1, $2 for numbered groups,
$<name> for named groups, $& for the full match,
$` for text before the match, $' for text after, and
$$ for a literal dollar sign.
ReDoS protection
Catastrophic backtracking — patterns like (a+)+$ on long input — can hang any
regex engine. We have two safety nets:
- Hard timeout: if matching takes longer than 2 seconds, we abort and tell you.
- Match cap: a maximum of 10,000 matches per evaluation. Beyond that we stop and mark "10000+" so the UI stays responsive.
Privacy
Your patterns and test text never leave the page. The engine is built into your browser. No external library is loaded, no analytics fires when you type, no requests go out.
Common use cases
- Validate email, URL, phone or postal-code patterns.
- Extract structured data from logs or scraped text.
- Build search-and-replace queries before running them in your editor.
- Debug a regex that "should work but doesn't" — the highlight makes the problem visible immediately.
- Learn regex by experimentation with the cheatsheet at the bottom.
Frequently Asked Questions
- How do I test a regular expression online?
- Paste your regex pattern into the pattern field and your test string into the text area. Matches are highlighted in real-time as you type, with capture groups shown in the side panel.
- Does this regex tester support all JavaScript flags?
- Yes, it supports all JavaScript regex flags: g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode) and y (sticky).
- Is my regex or test data stored anywhere?
- No. Everything runs locally in your browser. Your patterns and test text are never sent to any server or stored anywhere.
- Can I export my regex matches?
- Yes. All match groups and capture groups are displayed in the results panel, and you can use Replace mode to preview regex-based substitutions.
- Is this regex tester free?
- Yes, completely free with no usage limits, no sign-up required and no ads interrupting your workflow.