Regex Tester

Paste a JavaScript regular expression and a test string to see live highlighted matches and capture groups, including named groups. The pattern runs in your browser's own RegExp engine, not PCRE. Output is capped at 1,000 matches with a zero-length-match guard. The pattern and text never leave this tab.

Matches highlighted
Contact us at hello@localfirsttools.com or support@example.org.
Invalid: not-an-email
Match list
  1. #1hello@localfirsttools.com@14
    user=hellodomain=localfirsttools.com
  2. #2support@example.org.@43
    user=supportdomain=example.org.
2 matchesMatched on this device

Runs in this tab · nothing is uploaded · Verify in 10 seconds →

What the Regex Tester does

A regular expression describes a text pattern: character classes, quantifiers, anchors, alternation and capture groups. This tester runs your pattern against a test string as you type, highlights every match and lists capture groups, including named groups like (?<year>d{4}).

How the Regex Tester works

The pattern and flags are passed to JavaScript's own RegExp constructor and executed against the test string with exec. With the g or y flag it collects every match (guarding against zero-length-match loops); without them it stops at the first. Matching runs entirely in this tab.

Limits

Output is capped at 1,000 matches, with a zero-length-match guard. This is JavaScript regex, not PCRE.

~/faq

Frequently asked questions

Which regex dialect is this?

JavaScript (ECMAScript), exactly as your browser implements it. Lookbehind, named groups and the s and u flags all work in modern browsers, but PCRE-only syntax like atomic groups or \K will not.

What do the flags mean?

g finds all matches instead of the first, i ignores case, m makes ^ and $ match at line breaks, s lets . match newlines, u enables full Unicode mode, and y anchors each match at the exact position where the previous one ended.

Why does my pattern match an empty string over and over?

Patterns like a* can match zero characters. With the g flag this tool advances one position after every empty match, so it terminates instead of looping forever, and caps the list at 1000 matches.

Do I need to escape backslashes?

No. Type the pattern as you would between / / in JavaScript source, \d, \w, \b and friends work directly. You only need double backslashes when embedding the pattern in a JavaScript string literal.