snaptools

🔍 Regex Tester

Test, debug and preview regular expressions live

Load example:

Highlighted matches
Matches
2
Replace
Result preview
Contact us at [redacted] or [redacted]
\d

Any digit (0-9)

\w

Word character (a-z, A-Z, 0-9, _)

\s

Whitespace (space, tab, newline)

.

Any character except newline

^

Start of string / line (with m)

$

End of string / line (with m)

*

0 or more of the previous token

+

1 or more of the previous token

?

0 or 1 (optional) of the previous token

{n,m}

Between n and m repetitions

[abc]

Any one of a, b, or c

[^abc]

Any character except a, b, or c

(...)

Capture group

(?<name>...)

Named capture group

a|b

Match a or b

\b

Word boundary

Test and debug regular expressions with live match highlighting. Type a pattern and some test text to see every match, capture group and the effect of flags in real time, plus a replace preview — all processed in your browser.

Frequently asked questions

Enter your regex pattern and the flags you want (like g for global or i for case-insensitive), then paste the text to test against. Matches are highlighted instantly and capture groups are listed below.

It uses the JavaScript (ECMAScript) regular expression engine — the same one that runs in browsers and Node.js — so patterns behave exactly as they will in your JavaScript code.

Yes. Enter a replacement string (with $1, $2 for capture groups) to see the replaced output update live alongside your matches.