Regex Tester

Test regular expressions on the browser's real engine: highlighted matches, capture-group tables, a replace preview, flag controls and a plain-English token explainer — plus a library of ready patterns.

Developer Tools Runs in your browser · no upload

Reviewed 17 November 2026 · Free · No account needed

ExecutionYour browserInput never leaves your tab
File retentionNoneNothing is stored
AccountNot requiredNo sign-up, no paywall
PriceFreeNo trial, no usage cap on the tool itself

How to use

  1. Type the pattern (without the / delimiters) and toggle the flags you need: g, i, m, s, u, y.
  2. Matches are highlighted in the test text as you type; the table lists every match with its index and capture groups.
  3. Click any row to select that match in the text, or open Replace to preview a substitution with $1 and named-group references.
  4. Press Explain to see the pattern broken into tokens, or load one of the built-in recipes (email, URL, IPv4, ISO date and more).

Example

Input: Pattern [A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,} with the g flag

Output: contact@toolnexo.com and press@example.co.uk matched; hello@ and @nope.com rejected

How it works

The pattern is compiled as a JavaScript regular expression and run against the test text. Matches are highlighted and capture groups are listed. Invalid patterns report their syntax error.

The pattern is compiled with new RegExp on the browser's ECMAScript engine with the flags you toggle (g, i, m, s, u, y). With the g flag it walks match after match, recording each match's text, character position and capture groups; without g only the first match is reported. Zero-length matches advance one character so the loop cannot hang.

Worked example

The pattern \b\w+@\w+\.\w+\b against "mail bob@corp.com" reports 1 match at position 5: bob@corp.com.

Edge cases to know

  • This is JavaScript's regex dialect, not PCRE or RE2 — lookbehind and named-group behaviour follow your browser.
  • The match list shows up to 200 matches; the total count stays accurate and says when the list is truncated.
  • Invalid patterns report the engine's syntax error instead of matches; repeated flags are rejected.

Limits & compatibility

  • This is JavaScript's regex flavour: PCRE-only syntax such as \A, \Z or possessive quantifiers will not work.
  • The match table lists the first 500 matches; the total count is still exact.
  • A pattern with catastrophic backtracking can still stall the tab, because the engine itself is doing the work.
  • Zero-length matches are advanced by one character so the loop always terminates.

Privacy

Patterns and test text are evaluated in your browser. Nothing is sent to a server, so you can test against real logs or customer data.

Related tools

FAQ

Questions about Regex Tester

Which regex flavour does it use?

The browser's own ECMAScript engine — the same implementation that will run the pattern in real JavaScript code. It is not PCRE or RE2, so behaviour can differ from those flavours in areas such as lookbehind and unicode handling. Testing here means testing what your front end will actually execute.

Why does the match list stop at 200 entries?

That is a display cap so the page stays responsive on long documents. The total match count is always accurate regardless, and the list tells you when it has been truncated. Each listed match shows its position in the text and its capture groups, so you rarely need more than the first few anyway.

What happens with a pattern that matches empty strings?

Zero-length matches advance one character after each hit, which prevents the infinite loop a naive global loop would hit on patterns like a*. Invalid patterns and invalid flag combinations are reported with the engine's own error message instead of a result, and the available flags are g, i, m, s, u and y.