Regex Tester

Test and debug regular expressions with real-time matching

Enter test string to see matches

Use $1, $2, etc. for capture groups, $& for entire match

Enter replacement text above

Quick Reference

Character Classes

\d - digits (0-9)
\w - word chars (a-z, A-Z, 0-9, _)
\s - whitespace
. - any character
[abc] - a, b, or c
[^abc] - not a, b, or c

Quantifiers

* - 0 or more
+ - 1 or more
? - 0 or 1
{n} - exactly n
{n,} - n or more
{n,m} - between n and m

Anchors & Groups

^ - start of string
$ - end of string
\b - word boundary
() - capture group
(?:) - non-capture group
| - alternation (or)