Regex Tester
Live regular expression matching with match details, group capture, and a built-in cheatsheet.
g
Match Details
Enter a pattern and test string to see matches.
Common Patterns
Character Classes
.Any character (except newline)
\wWord char [a-zA-Z0-9_]
\WNon-word character
\dDigit [0-9]
\DNon-digit
\sWhitespace
\SNon-whitespace
[abc]Character set
[^abc]Negated set
[a-z]Character range
Quantifiers
*0 or more (greedy)
+1 or more (greedy)
?0 or 1 (optional)
{n}Exactly n times
{n,}n or more times
{n,m}Between n and m times
*?0 or more (lazy)
+?1 or more (lazy)
Anchors & Boundaries
^Start of string/line
$End of string/line
\bWord boundary
\BNon-word boundary
Groups
(abc)Capture group
(?:abc)Non-capturing group
(?<n>abc)Named capture group
a|bAlternation (a or b)
Lookaround
(?=abc)Positive lookahead
(?!abc)Negative lookahead
(?<=abc)Positive lookbehind
(?<!abc)Negative lookbehind
Escapes
\nNewline
\tTab
\\Literal backslash
\.Literal dot
\(Literal parenthesis