Regex tester
Test JavaScript regular expressions with live highlights.
Matches
Runs in your browser with a 1-second safety limit. Your text is not sent anywhere.
About this tool
This tool tests a JavaScript regular expression against your text and highlights every match as you type. It lists each match with its position and capture groups (including named groups), and previews the result of a replace with $1, $<name> or $&. Patterns run in a background worker and are stopped after 1 second, so a slow pattern cannot freeze the page.
At a glance
- What it does
- Test JavaScript regular expressions with live highlights.
- Price
- Free, no sign-up
- Works in
- Your browser, on phone or computer. Works offline after the first visit.
- Privacy
- What you type never leaves your device.
How to test a regular expression
- Type the pattern without the surrounding slashes.
- Tick the flags you need (g for all matches, i to ignore case, m for line-by-line ^ and $).
- Paste test text, check the highlights and groups, and optionally type a replacement.
Private
Your text stays in your browser and is never sent to a server.
Instant
Results update as you type, with nothing to install.
Free
No sign-up, no limits and no ads inside your writing space.
Frequently asked questions
Which regex flavour does this use?
JavaScript (ECMAScript) regular expressions, the same engine as your browser and Node.js. Most syntax matches PCRE, Python and Java, but features like possessive quantifiers and recursion are not supported.
Why does my pattern find only one match?
Without the g (global) flag, JavaScript stops after the first match. Tick g to find all matches; replace also changes all of them only when g is on.
What is catastrophic backtracking?
Some patterns, such as (a+)+$, take exponentially longer on certain inputs. Here such a pattern is stopped after 1 second with an explanation, instead of freezing your browser tab.
How do I use a capture group in the replacement?
Use $1, $2 for numbered groups, $<name> for named groups and $& for the whole match. For example pattern (\w+)@(\w+) with replacement $2: $1 turns asha@example into example: asha.



