Regex Tester

Test a regular expression against sample text — live match highlighting, capture groups and a replace preview. Runs on your browser's own regex engine; nothing is uploaded.

/ /
Examples
Matches
Advertisement
JavaScript flavour

This uses the browser's native RegExp — close to PCRE, but not identical (e.g. no \A, lookbehind support varies).

A regular expression describes a search pattern. Type one above and it runs live against your test string: matches are highlighted, the count updates, capture groups from the first match are listed, and the replace box previews String.replace (use $1, $2 or $<name> for groups).

This uses your browser's native JavaScript regex engine, so it's the exact behaviour your JS code will get — but it differs slightly from PCRE/Python (flag set is gimsuy, some lookbehind/Unicode-property support depends on your browser). Nothing is sent anywhere; an invalid pattern just shows the engine's error.

Read more on Wikipedia
FAQ

Frequently asked

Which regex flavour does this use?
Your browser's JavaScript (ECMAScript) engine, so behaviour matches what you'll get in JS. Some features from PCRE or Python, such as recursion, are not available.
Is my pattern or test text uploaded?
No. Everything runs locally in your browser — nothing is sent anywhere.
What do the regex flags mean?
g finds all matches, i is case-insensitive, m makes ^ and $ match per line, and s lets . match newlines.
Copied to clipboard