Skip to content
TNToolsNexus

Regex tester

Test regular expressions live: highlighted matches, indices, capture groups (named too), flag toggles, and plain error messages.

Flags

Patterns and test text stay in your browser — matching runs on your device.

Type a pattern, toggle flags, paste test text — and watch highlighted matches, positions, and capture groups (named included) update live, with the engine’s real error message the moment a pattern goes wrong. JavaScript flavor: exactly what your code will do.

How to test a regex

  1. Enter the pattern (no surrounding slashes) and tick the flags — g is on by default.
  2. Paste the test string.
  3. Read the highlighted preview and the per-match list with indices and groups.

Built for the debugging loop

Regex development is guess-check-adjust, and the check step should be instant and honest. The highlight view answers “what did it grab?” at a glance — including the classic too-greedy .* swallowing half the line. The match list answers the follow-ups: exact offsets (for slicing), and what each capture group extracted, which is where most “the regex matches but my code gets undefined” bugs live. Invalid patterns surface the engine’s own message (“Unmatched ‘(’”) rather than silently matching nothing, and zero-length matches are shown as such instead of looping the page.

JavaScript flavor, stated up front

Testers that run PCRE while you write JavaScript produce patterns that pass the tester and fail in production. This one runs your browser’s engine, so behavior — including u-flag Unicode classes and multiline anchors — is precisely what new RegExp(pattern, flags) will do in your code. Extracting structured text at scale? Pair with the CSV ⇄ JSON converter for the tabular part, and the JSON formatter to inspect results.

Private by design

Test text is usually real data — logs, exports, config. It stays in your browser: evaluation is local, nothing is transmitted or retained.

Last updated:

Frequently asked questions

Which regex flavor is this?
JavaScript (ECMAScript) — the engine in your browser, byte-for-byte what your JS/TS code will do. Most patterns port cleanly from PCRE, with the usual differences: no lookbehind quirks in modern JS (it's supported), no possessive quantifiers, and \\p{…} classes need the u flag.
What do the flags do?
g finds all matches instead of the first; i ignores case; m makes ^ and $ match at every line; s lets . cross newlines; u enables full Unicode (needed for \\p{L} and correct emoji handling). The g flag is on by default here because listing all matches is what a tester is for.
How do I see what my capture groups matched?
Each match in the list shows its position and every group — numbered ($1, $2) and named ((?<name>…)) — so you can confirm the extraction, not just the match.
Why does my pattern match empty strings everywhere?
Quantifiers like a* or (\\d+)? happily match zero characters. The tester shows these as "(empty match)" instead of hanging — and their presence usually means the pattern needs + instead of *, or an anchor.
Is my test data sent anywhere?
No — patterns and text are evaluated in your browser and never leave it.

Related tools

CSV ⇄ JSON Converter

Convert CSV to JSON objects (or arrays) and JSON back to CSV — RFC 4180 quoting done right, comma/semicolon/tab, copy or download.

JSON Formatter

Format, validate, and minify JSON as you paste — 2/4-space or tab indentation, clear syntax errors, copy or download. Private.

Case Converter

Convert text to UPPERCASE, lowercase, Title Case, Sentence case, and more — instantly, in your browser, with one-click copy.