Regex Tester

Regular expressions (regex) are powerful patterns used to search, match, and manipulate text. Type your pattern and test string below — matches are highlighted in real time as you type. Supports all standard JavaScript regex flags: g (global), i (case-insensitive), m (multiline), and s (dotAll). Capture groups are displayed individually below the output.

/
Match Highlights
Matches will be highlighted here…
Regex Quick Reference
.Any character except newline
\dDigit [0-9]
\wWord character [A-Za-z0-9_]
\sWhitespace (space, tab, newline)
\D \W \SNon-digit, non-word, non-whitespace
^ $Start / end of string (or line with m)
* + ?0+, 1+, 0 or 1 repetitions
{n} {n,m}Exactly n, or n to m repetitions
[abc]Character class — a, b, or c
[^abc]Negated class — not a, b, or c
(abc)Capture group
(?:abc)Non-capture group
a|bAlternation — a or b
\bWord boundary
(?=abc)Positive lookahead
(?!abc)Negative lookahead