Skip to content
nah

Regex Tester

Test regular expressions with live match highlighting, capture groups, and replace — all in your browser.

100% in your browser — files never leave your device

/ /g
Examples:
Replace

How the regex tester works

Matching runs on the same RegExp engine your browser uses everywhere else — there's no custom parser standing between what you type and how it behaves. The pattern recompiles on every keystroke against all six JavaScript flags (g, i, m, s, u, y), and the preview highlights every match in the test string live.

Named capture groups — (?<name>...) — show up in the match list alongside numbered groups, and you can reference either in the replacement field: $1 for positional, ${name} for named. This mirrors exactly how String.replace() resolves them in real code, so what you build here is a direct copy-paste.

Because this is JavaScript's regex engine specifically, subtle behavior differs from PCRE, Python's re, or POSIX regex — lookbehind support, Unicode property escapes, and possessive quantifiers all vary by engine. If the pattern is headed for a different language or database, test it there too before trusting this preview completely.

Frequently asked questions

Is my test data sent anywhere?

No. All matching runs entirely in your browser using the native JavaScript RegExp engine. Nothing leaves your device.

Which flags are supported?

g (global), i (case-insensitive), m (multiline), s (dotAll — dot matches newline), u (unicode), and y (sticky). Combine them freely; the tool rebuilds the RegExp on every keystroke.

How do named capture groups work?

Use (?<name>...) syntax. Named groups appear in the match list alongside numbered captures. In the replacement input you can reference them as ${name}.

Related tools