Regex Playground

Test JavaScript regular expressions with live highlights, capture groups, and replace preview.

What you can do

  • Toggle flags g, i, m, s, u, y
  • See all matches with index, line/column, and groups
  • Preview replace with $1, $&, $$, named groups
  • Use presets (email, URL, IPv4, dates, etc.)

Layout

Sidebar: pattern, flags, mode, replacement, presets, cheat sheet.

Test string editor with match highlights.

Bottom pane: match table or replace preview.

On narrow screens use Pattern, Test, and Results tabs.

Modes

ModeShows
MatchTable of matches and capture groups
ReplaceFull string after replacement

Without g, only the first match is listed/replaced.

Toolbar

ActionEffect
SampleLoads email preset + primer text
PasteReplaces test string from clipboard
ClearClears pattern, test, replacement
Copy resultReplace mode only

Tips

Debug exec() behavior: Turn off g for single-match debugging.

Multiline logs: Enable m when testing ^ / $ per line.

Dedupe by capture: Copy a pattern into Remove Duplicates (Custom regex mode).

Keep in mind

JavaScript regex only — not PCRE or Python syntax. Very large test strings with complex patterns may be slow.

App shortcuts

ActionShortcut
Search tools⌘ K
Close current tab⌘⌥E (Ctrl+Alt+E on Windows)

Note: ⌘W closes the browser tab. ⌘⇧E focuses the Explorer in Cursor/VS Code. Use ⌘⌥E (Ctrl+Alt+E) to close the current tool tab (click inside the app first so the IDE does not steal the shortcut).