Regular Expression Tester
Test and validate regular expressions with live results and match highlighting.
Regular Expression
Enter your regex pattern
Test String
Enter text to test against your regex
Results
No matches found
Common Patterns
Click to use these common regex patterns
Email
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA...
Phone (US)
^$$?([0-9]{3})$$?[-. ]?([0-9]{3})[-. ]?(...
URL
^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#...
IP Address
^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-...
Credit Card
^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{...
Password (Strong)
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!...
Date (YYYY-MM-DD)
^\d{4}-\d{2}-\d{2}$
Hex Color
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
Regex Quick Reference
Character Classes
.
- Any character\d
- Digit (0-9)\w
- Word character\s
- Whitespace[abc]
- Character set[^abc]
- Negated set
Quantifiers
*
- 0 or more+
- 1 or more?
- 0 or 1{n}
- Exactly n{n,m}
- Between n and m
Anchors
^
- Start of string$
- End of string\b
- Word boundary\B
- Non-word boundary