Toolbox runs in your browser

Index / Developer

Regex Tester

JavaScript regular expressions, matched live as you type. Flags behave exactly as they would in your code, including what happens when you leave g off.

Pattern
Flags
Test string
Matches highlighted
Ready
0

matches

Replacement
$1 to $9 for numbered groups, $<name> for named ones, $& for the whole match, $$ for a literal dollar.

Match detail

Two things worth knowing This uses your browser's own regex engine, so results match what your JavaScript will do — but not necessarily PCRE, Python, Go or RE2, which differ on lookbehind, named group syntax and backtracking.

A pattern with nested quantifiers over alternation, such as (a+)+$, can take exponential time on a non-matching string and will freeze this tab, because a regex runs to completion and cannot be interrupted. The input here is capped to reduce the blast radius, not to eliminate it.