NV ToolkitFormat · Validate · Convert

Developer Tools

Regex Tester & Debugger

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

  • Live inline match highlighting
  • Capture groups incl. named groups
  • Replace preview with $1 / $<name>

Runs entirely in your browser — nothing you paste or open here is uploaded, logged, or stored.How we handle data →

Why this tool

See what your pattern actually matches

Regular expressions fail silently — a pattern that looks right matches nothing, or worse, matches too much. Instant visual feedback closes that loop.

Matches as you type

Every keystroke re-runs the pattern and repaints highlights over your test text, alternating colors so adjacent matches stay distinguishable.

Groups, unpacked

Each match row expands its numbered and named capture groups — the difference between knowing a pattern matched and knowing what it captured.

Replace, previewed

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.

Real JavaScript semantics

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

A faster loop for writing regular expressions

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.

Flags, briefly

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.

Worked example

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.

Five patterns run against real text, with the exact matches produced (g flag)
PatternTest stringMatches
[\w.+-]+@[\w-]+\.[\w.]+Reach ada@example.com or sales+eu@nv-toolkit.dev2 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}\bbg #fff, accent #1E90FF, bad #123452 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}\bfrom 10.0.0.14 via 192.168.1.12 matches: 10.0.0.14 · 192.168.1.1
(?<user>[\w.+-]+)@(?<domain>[\w-]+\.[\w.]+)grace.hopper@navy.mil1 match: grace.hopper@navy.mil — groups user = grace.hopper, domain = navy.mil

Help

Frequently asked questions

Everything you need to know about the Regex Tester.

01How do I test a regular expression here?

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.

02Which regex dialect does this use?

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.

03Why does my pattern match in Python but not here?

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.

04Can a pattern hang my browser?

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

Related tools

Learn the format

Related guides

All guides →