MockFoxAdvertise

Regex Tester

Updated Free mock REST & WebSocket APIs

Write a regular expression and see every match highlighted as you type, with capture groups broken out and a live replace preview. It uses JavaScript regex syntax and runs entirely in your browser.

/g
Matches2 matches
Released 2026-10-18, patched 2026-11-02 (not 2026-13-40).
#IndexMatchGroup 1 (year)Group 2 (month)Group 3 (day)
192026-10-1820261018
2292026-11-0220261102
Replace preview
Released 18/10/2026, patched 02/11/2026 (not 2026-13-40).

Use $1 for group 1, $<name> for named groups, $& for the whole match. Without the g flag only the first match is replaced.

🔒 Runs in your browser with JavaScript (ECMAScript) regex syntax — the flavor used by Node.js, Deno and every browser. Nothing is uploaded.

How to test a regex

  1. Type a pattern (without the surrounding slashes) or load one of the common patterns.
  2. Toggle flags such as g (all matches) and i (ignore case).
  3. Paste your test text: matches are highlighted and listed with their capture groups. Add a replacement to preview a find-and-replace.

Regex flags explained

  • g global — find every match, not just the first.
  • i ignore case — a also matches A.
  • m multiline — ^ and $ match at each line break, not only the start and end of the text.
  • s dotAll — . also matches newlines.
  • u unicode — treat the pattern as code points (so emoji count as one character) and enable \p{L}-style property escapes.
  • y sticky — match only at the current position; used in tokenizers.

Quick syntax reference

SyntaxMatches
.Any character except a line break
\d \w \sDigit, word character ([A-Za-z0-9_]), whitespace — uppercase negates
[abc] [^abc] [a-z]One of, none of, a range
^ $ \bStart, end, word boundary
* + ? {2,5}0+, 1+, optional, between 2 and 5 times; add ? to make lazy
(…) (?:…) (?<name>…)Capturing, non-capturing and named groups
a|bEither side
(?=…) (?!…) (?<=…) (?<!…)Lookahead, negative lookahead, lookbehind, negative lookbehind

Avoid nested quantifiers such as (a+)+$: on input that almost matches they cause catastrophic backtracking, which can freeze a browser tab or stall a server (a ReDoS).

Related tools

Frequently asked questions

Is my test text sent to a server?

No. This tool runs entirely in your browser with JavaScript, so your test text never leaves your device and isn't logged or stored. You can even use it offline once the page has loaded.

Which regex flavor does this use?

ECMAScript (JavaScript), the same syntax as Node.js, Deno and every browser. It's close to PCRE and Python, but Python writes named groups as (?P<name>…) and JavaScript has no possessive quantifiers or recursion.

Why does my pattern only match once?

Without the g flag a JavaScript regex stops after the first match. Turn on g to find them all — the replace preview follows the same rule.

How do I match a literal dot, plus or bracket?

Escape it with a backslash: \. \+ \( \[. You don't need to escape / here because you type the pattern without surrounding slashes.

Your business here? Sponsor this tool from $16/week. See placements