Regex Tester

Regex Tester

//g

g: Global — find all matches

Enter a Pattern to Begin

Type a regular expression in the pattern field and some test text below it. Matches will be highlighted in real time as you type.

.Any character except newline
\dAny digit [0-9]
\DAny non-digit [^0-9]
\wWord char [a-zA-Z0-9_]
\WNon-word character
\sWhitespace (space, tab, newline)
\SNon-whitespace
[abc]Any of: a, b, or c
[a-z]Any character in range a–z
[^abc]Any char NOT a, b, or c
Email Address
[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}
HTTP/HTTPS URL
https?://[^\s/$.?#].[^\s]*
IPv4 Address
\b(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\b
ISO Date (YYYY-MM-DD)
\b\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])\b
US Phone Number
\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}
US ZIP Code
\b\d{5}(?:-\d{4})?\b
Hex Color Code
#(?:[0-9a-fA-F]{3}){1,2}\b
HTML Tag
<[^>]+>
Username (3–20 chars)
[a-zA-Z0-9_]{3,20}
IPv6 Address
([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}
Markdown Link
\[([^\]]+)\]\(([^)]+)\)
Strong Password
(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}