Dev Tools
Client-sidefiles never upload

Regex Replace + Group Preview

Live three-pane editor: **Pattern** (/.../flags) + **Replacement** ($1, $2, $<name>) + **Input**. See highlighted matches in the source, the replaced output, and a table of every match's captures (including named groups). All 6 flags toggleable.

//gu
$1–$9 = captures; $<name> = named group; $& = full match; $$ = literal $
3 matches
alice@example.com, bob@dev.tw, c@x.org mark.liu@psp-power.com.tw
#MatchCaptures
1alice@example.com
$1: alice
$2: example
$3: com
2bob@dev.tw
$1: bob
$2: dev
$3: tw
3c@x.org
$1: c
$2: x
$3: org
β€ΊHow to use
  1. Type a regex into Pattern β€” the flag chips on the right apply automatically; syntax errors surface inline.
  2. Use Replacement with $1, $2 (numeric captures), $ (named groups), $& (whole match), or $$ (literal $).
  3. Toggle any of 6 flags (g/i/m/s/u/y) live.
  4. Read off, in order: source with hl-highlighted matches, the replaced output, and a per-match captures table.
Tips
  • Without g we still walk every match (less confusing than seeing only the first).
  • u is on by default β€” required for \p{Script=Han}-style Unicode property escapes.
  • s (dotAll) lets . match newlines β€” invaluable for multi-line captures.
  • y (sticky) only matches from lastIndex. Mostly for lexers; rarely needed casually.
  • vs regex101.com: powerful but heavy and ad-supported. We're light + offline + instant.

πŸ’‘ Runs 100% locally β€” pattern and input never leave your browser. Safe for PII. Zero-width matches are protected against infinite loops.

Related tools