Regex Tester

Test regular expressions with live highlighting, match details, and replacement mode.

Flags:
Replace Mode
Enter pattern, test string, and replacement above
Quick Reference & Examples
PatternMatches
.Any character (except newline)
\d / \DDigit / Non-digit
\w / \WWord char / Non-word char
\s / \SWhitespace / Non-whitespace
^ / $Start / End of string (or line with m flag)
\b / \BWord boundary / Non-boundary
? + * {n,m}Optional / One+ / Zero+ / Quantifiers
(...) (?:...)Capture group / Non-capturing group
(?<name>...)Named capture group
[abc] [^abc]Character class / Negated class
a|bAlternation (a or b)
(?=...) (?!...)Lookahead / Negative lookahead