Regex Tester
Common Patterns
Email Address
^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$
URL
https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{2,256}\.[a-z]{2,6}\b([-a-zA-Z0-9@:%_\+.~#?&//=]*)
Phone Number
^\+?[1-9]\d{1,14}$
Date (YYYY-MM-DD)
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01])$
Quick Reference
. |
Any character except newline |
\w |
Word character [A-Za-z0-9_] |
\d |
Digit [0-9] |
\s |
Whitespace character |
[abc] |
Character class |
^ |
Start of string/line |
$ |
End of string/line |