Back to tools

Regex Library

Collection of 20+ commonly used regex patterns: email, URL, IP, date, UUID, JWT, phone, and more. One-click copy.

RegexPatternsLibrary

Validation

Email

Standard email address

^[\w.-]+@[\w.-]+\.[a-zA-Z]{2,}$

e.g. user@example.com

URL

HTTP/HTTPS URL

^https?:\/\/[\w\-]+(\.[\w\-]+)+[\w\-.,@?^=%&:/~+#]*$

e.g. https://example.com/path

IPv4

IPv4 address

^((25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(25[0-5]|2[0-4]\d|[01]?\d\d?)$

e.g. 192.168.1.1

IPv6

IPv6 address (full)

^([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}$

e.g. 2001:0db8:85a3:0000:0000:8a2e:0370:7334

Phone (intl)

E.164 international phone

^\+?[1-9]\d{1,14}$

e.g. +33612345678

Domain

Domain name

^[a-zA-Z0-9][a-zA-Z0-9-]*\.[a-zA-Z]{2,}$

e.g. example.com

Date/Time

Date (ISO)

YYYY-MM-DD

^\d{4}-\d{2}-\d{2}$

e.g. 2026-01-15

Date (DD/MM/YYYY)

DD/MM/YYYY

^\d{2}/\d{2}/\d{4}$

e.g. 15/01/2026

Time (24h)

HH:MM 24-hour

^([01]\d|2[0-3]):[0-5]\d$

e.g. 14:30

ISO DateTime

ISO 8601 datetime

^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}

e.g. 2026-01-15T14:30:00Z

Format

Hex Color

#RGB or #RRGGBB

^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$

e.g. #ff5733

UUID

UUID v4 format

^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$

e.g. 550e8400-e29b-41d4-a716-446655440000

Semver

Semantic versioning

^\d+\.\d+\.\d+(-[\w.]+)?(\+[\w.]+)?$

e.g. 2.1.0-beta.1

Slug

URL-safe slug

^[a-z0-9]+(-[a-z0-9]+)*$

e.g. my-blog-post

JWT

JSON Web Token

^eyJ[A-Za-z0-9_-]+\.eyJ[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$

e.g. eyJhbGci...

JSON String

Valid JSON string

^"(?:[^"\\]|\\.)*"$

e.g. "hello \"world\""

Finance

Credit Card

16-digit card number

^\d{4}[- ]?\d{4}[- ]?\d{4}[- ]?\d{4}$

e.g. 4111 1111 1111 1111

Security

Strong Password

Min 8 chars, upper+lower+digit+special

^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$

e.g. Str0ng!Pw

Web

HTML Tag

Match HTML tags

<\/?[a-z][\s\S]*?>

e.g. <div class='x'>

Network

MAC Address

Network MAC address

^([0-9A-Fa-f]{2}[:-]){5}[0-9A-Fa-f]{2}$

e.g. 00:1A:2B:3C:4D:5E