Test and debug regular expressions with real-time matching, flags support, and replacement functionality.
Enter a regex and test text to see matches...
Detailed match information will appear here...
.
Any character except newline
\w
Word character [a-zA-Z0-9_]
\d
Digit [0-9]
\s
Whitespace character
^
Start of string/line
$
End of string/line
*
Zero or more
+
One or more
?
Zero or one
{n}
Exactly n times
{n,}
At least n times
{n,m}
Between n and m times
[abc]
Any of a, b, or c
[^abc]
Not a, b, or c
[a-z]
Range from a to z
\b
Word boundary
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
Validates standard email format with proper domain structure.
^\(\d{3}\)\s\d{3}-\d{4}$
Matches (123) 456-7890 format.
^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$
Comprehensive URL validation for web addresses.
^\d{4}\s\d{4}\s\d{4}\s\d{4}$
Basic credit card format validation (16 digits).
^\d{4}-\d{2}-\d{2}$
Validates ISO 8601 date format.
^#[0-9A-Fa-f]{6}$
Validates 6-digit hexadecimal color codes.
Use specific character classes instead of broad wildcards when possible.
Use ^ and $ to anchor patterns to start/end for faster matching.
Nested quantifiers can cause exponential backtracking.
Use (?:...) instead of (...) when you don't need capture groups.
Patterns like (a+)+ can cause exponential time complexity.
.* will match everything - use .*? for lazy matching when appropriate.
.* matches everything including newlines - be specific about what you want.
Don't capture groups you don't need - use (?:...) for grouping only.