Searchable reference of common regex patterns for email, URL, phone, dates, and more.
^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,}$
user@example.com
https?:\/\/[\w\-._~:/?#\[\]@!$&'()*+,;=%]+
https://example.com/path
\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}
(555) 123-4567
\+?\d{1,3}[-.\s]?\(?\d{1,4}\)?[-.\s]?\d{1,4}[-.\s]?\d{1,9}
+91 98765 43210
\b(?:\d{1,3}\.){3}\d{1,3}\b
192.168.1.1
([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}
2001:0db8:85a3:0000:0000:8a2e:0370:7334
[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
550e8400-e29b-41d4-a716-446655440000
#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})
#ff6600
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*]).{8,}$
P@ssw0rd!
^[a-zA-Z0-9_-]{3,16}$
user_name
^[a-z0-9]+(?:-[a-z0-9]+)*$
my-blog-post
\b(?:\d[ -]*?){13,16}\b
4111 1111 1111 1111
\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])
2024-03-15
(?:0[1-9]|[12]\d|3[01])\/(?:0[1-9]|1[0-2])\/\d{4}
15/03/2024
(?:[01]\d|2[0-3]):[0-5]\d(?::[0-5]\d)?
14:30:00
\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?
2024-03-15T14:30:00Z
<([a-z][a-z0-9]*)\b[^>]*>(.*?)<\/\1>
<div class='x'>content</div>
[.#]?[a-zA-Z_][\w-]*(?:\[[^\]]+\])?(?:::[a-z-]+)?
.class-name
import\s+.*\s+from\s+['"].*['"]
import React from 'react'
(?:function|const|let|var)\s+\w+\s*(?:=\s*)?\(
function hello(
\[([^\]]+)\]\(([^)]+)\)
[text](url)
^\s+|\s+$
hello
^(.*)(?:\r?\n\1)+$
line\nline
^\s*$
^-?\d+$
-42
^-?\d+\.\d+$
3.14
^\d{1,3}(,\d{3})*(\.\d+)?$
1,234,567.89