Regex Tester
Test a regular expression against text with every match highlighted directly in place, not just listed separately, plus numbered and named capture groups broken out per match. Toggle case-insensitive, multiline, and dot-matches-newline flags live. Runs entirely client-side using JavaScript's native regex engine — nothing is uploaded.
About this tool
This tool tests a regular expression against text and shows every match highlighted directly in place, not just listed out separately — the fastest way to actually see whether a pattern does what you think it does. Regular expressions are notoriously easy to get subtly wrong (an unescaped special character, a greedy quantifier matching more than intended, a capture group in the wrong spot), and the usual way to check is running actual code and printing the result — this skips that round-trip entirely. Every match highlights inline as you type, with each match's numbered and named capture groups broken out below it, and toggling case-insensitive/multiline/dot-matches-newline flags updates everything live. It always searches for every match in the text, not just the first — that's what makes highlighting the whole thing possible, so there's no separate "global" flag to remember to turn on. It runs entirely client-side, using JavaScript's own native regular expression engine — nothing is uploaded, and nothing about your pattern or text is retained once you leave the page.
What you can do
- Test a regular expression against text live, as you type
- Every match highlighted directly in the text, not just listed separately
- Toggle case-insensitive, multiline, and dot-matches-newline flags
- See numbered and named capture groups for every match
- Nothing is uploaded — matching runs entirely in your browser
How to use
Step 1
Write a pattern
Type a regular expression — errors (like an unclosed group) show up immediately.
Step 2
Set flags if needed
Toggle case-insensitivity, multiline, or dot-matches-newline.
Step 3
Paste text to test
Every match highlights directly in the text, with capture groups broken out below.
Example
A pattern like this one extracts a date's parts using named capture groups:
Pattern
(?<year>\d{4})-(?<month>\d{2})-(?<day>\d{2})Against "Event on 2024-05-01", this highlights "2024-05-01" as the match and breaks out year=2024, month=05, day=01 as named groups below it — exactly what you'd get back from a real JavaScript match, without writing any code to check.
How your data is handled
This tool is labeled 🟢 Browser: your pattern and text are matched directly using JavaScript's native regular expression engine, right in your browser. Nothing is uploaded to a server, and nothing about it is retained once you leave the page.
Frequently asked questions
Why does it say my pattern is invalid?+
The pattern doesn't compile as a valid JavaScript regular expression — usually an unclosed group/bracket, an invalid escape sequence, or a flag combination JavaScript doesn't support. The error message is JavaScript's own, naming exactly what's wrong.
Is there a "global" flag toggle?+
No — every match in the text is always found and highlighted, which is what a global search does, so it's applied automatically rather than being a checkbox you could forget to enable. If you only care about the first match, just look at the first highlighted one.
What's the difference between numbered and named groups?+
Numbered groups ((\d+)) are referenced by position ($1, $2, ...); named groups ((?<year>\d+)) are referenced by the name you gave them. A pattern can mix both, and this tool shows whichever your pattern actually uses for each match.
Does this support every JavaScript regex feature?+
Yes — it runs your pattern through JavaScript's own native RegExp engine, the same one your code would use, so anything valid there (lookaheads, lookbehinds, named groups, unicode property escapes with the u flag, etc.) works here too.
Is my pattern or text uploaded anywhere?+
No — matching happens directly in your browser using JavaScript's native regex engine. Nothing you type here ever leaves your device.