Matches as you type
Every keystroke re-runs the pattern and repaints highlights over your test text, alternating colors so adjacent matches stay distinguishable.
Developer Tools
Type a pattern, watch matches light up in your text — with named capture groups, a replace preview, and flag toggles that behave exactly like JavaScript's RegExp.
In short
A regex tester runs a pattern against sample text and shows every match, its position and its capture groups as you type, so false positives and missed matches are visible before the pattern reaches production. This one uses the browser's native JavaScript RegExp engine with all six flags, lists named groups, and previews replacements with numbered and named-group references.
By NaveenKumar T · Updated
Learn: Regular Expressions Explained: A Practical Cheat Sheet With Tested Examples
Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →
Why this tool
Regular expressions fail silently — a pattern that looks right matches nothing, or worse, matches too much. Instant visual feedback closes that loop.
Every keystroke re-runs the pattern and repaints highlights over your test text, alternating colors so adjacent matches stay distinguishable.
Each match row expands its numbered and named capture groups — the difference between knowing a pattern matched and knowing what it captured.
Switch to the Replace tab and see the substitution result live, with full support for $1, $&, and $<name> references — before you run it on real data.
Patterns run on your browser's native RegExp engine with the exact flags you toggle, so what works here works verbatim in your code.
Learn more
Nobody writes a non-trivial regex correctly on the first try. The productive workflow is iterative: paste representative text, write the smallest pattern that matches something, then tighten it while watching the highlights — every false positive and missed match is visible immediately instead of surfacing in production logs.
Capture groups deserve the same scrutiny as the overall match. The match table shows numbered groups and named groups per match, so extraction patterns — pulling the domain from emails, the timestamp from log lines, the version from user agents — can be validated field by field before they ship.
g finds all matches instead of the first; i ignores case; m makes ^ and $ match per line; s lets . cross newlines; u enables full Unicode handling (and stricter syntax); y anchors each match at the exact position the last one ended. The tester forces a global scan for listing and highlighting — your saved flag combination is what the Replace tab and your production code will use, drawing on the same RegExp engine your JavaScript runs on.
Five patterns worth keeping within reach, each written exactly as you would type it into the pattern field — no surrounding slashes — and run with the g flag against the test string beside it. The Matches column lists the literal text each pattern found, so you can paste any row into the tester above and reproduce it keystroke for keystroke.
| Pattern | Test string | Matches |
|---|---|---|
| [\w.+-]+@[\w-]+\.[\w.]+ | Reach ada@example.com or sales+eu@nv-toolkit.dev | 2 matches: ada@example.com · sales+eu@nv-toolkit.dev |
| \d{4}-\d{2}-\d{2} | Released 2026-06-06, patched 2026-09-10. | 2 matches: 2026-06-06 · 2026-09-10 |
| #(?:[0-9a-fA-F]{3}){1,2}\b | bg #fff, accent #1E90FF, bad #12345 | 2 matches: #fff · #1E90FF — the five-digit #12345 is rejected, because \b cannot fall between 3 and 4 |
| \b(?:\d{1,3}\.){3}\d{1,3}\b | from 10.0.0.14 via 192.168.1.1 | 2 matches: 10.0.0.14 · 192.168.1.1 |
| (?<user>[\w.+-]+)@(?<domain>[\w-]+\.[\w.]+) | grace.hopper@navy.mil | 1 match: grace.hopper@navy.mil — groups user = grace.hopper, domain = navy.mil |
Help
Everything you need to know about the Regex Tester.
Type the pattern (without surrounding slashes), toggle any flags, and paste test text below. Matches highlight instantly, and the table on the right lists each match with its position and capture groups. The Sample button loads an email-matching example with named groups to explore.
JavaScript's native RegExp — the ECMAScript dialect — with all six flags (g, i, m, s, u, y) available as toggles. Lookahead, lookbehind, named groups and Unicode property escapes work in any modern browser. Patterns written for PCRE or Python mostly transfer, but dialect-specific syntax like atomic groups won't.
Dialect differences. The usual suspects: Python's (?P<name>…) is (?<name>…) in JavaScript, re.VERBOSE whitespace-mode doesn't exist, and \A/\Z anchors become ^/$ with the m flag unset. The error message under the pattern field reports exactly what JavaScript's parser rejected.
Catastrophic backtracking is real — patterns like (a+)+b against long non-matching input can take exponential time in any backtracking engine. Keep test inputs modest while iterating; match listing is capped to keep the UI responsive.
Keep working
Sixteen everyday text operations in one tool — case conversion, line sorting and deduping, whitespace cleanup, counts.
Format, beautify, and validate JSON instantly in a professional VS Code-style editor — free, fast, and 100% private.
Turn one-line query soup into clause-aligned, review-ready SQL — dialect-aware for MySQL, Postgres, T-SQL and SQLite.
Developer Tools
Turn any literal text into a safe regex fragment — five flavors, so the escaping matches the engine that will actually compile the pattern.
Developer Tools
Learn the format
A practical regex cheat sheet: metacharacters, quantifiers, groups, lookarounds and JavaScript flags, with tested patterns for emails, dates and slugs.
7 min readGuide · Developer ToolsFreeFormatter.com has been retired and its tool pages now return 404. A verified map of where each formatter, validator, escaper and encoder moved.
6 min read