WKIT

Regex Pattern Library

A collection of tested, commonly-used regular expressions. Browse patterns for emails, URLs, dates, phone numbers, and more. Click any pattern to test it.

Regex Pattern Library
A collection of tested, commonly-used regular expressions. Click any pattern to test it.
Patterns (27)
Email Address
web

Validates standard email addresses

^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
URL
web

Validates HTTP/HTTPS URLs

^https?:\/\/(?:www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b(?:[-a-zA-Z0-9()@:%_\+.~#?&\/=]*)$
Domain Name
web

Validates domain names

^(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$
URL Slug
web

URL-friendly slug format

^[a-z0-9]+(?:-[a-z0-9]+)*$
UUID
identifiers

Validates UUID v4 format

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

Validates hex color codes

^#?([a-fA-F0-9]{6}|[a-fA-F0-9]{3})$
MAC Address
identifiers

Validates MAC addresses

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

Validates IPv4 addresses

^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$
IPv6 Address
network

Validates full IPv6 addresses

^(?:[a-fA-F0-9]{1,4}:){7}[a-fA-F0-9]{1,4}$
Port Number
network

Validates port numbers (0-65535)

^(?:[0-9]{1,4}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$
ISO Date
datetime

ISO 8601 date format (YYYY-MM-DD)

^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])$
Time (24h)
datetime

24-hour time format

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

Full ISO 8601 datetime

^\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])T(?:[01]\d|2[0-3]):[0-5]\d:[0-5]\d(?:\.\d+)?(?:Z|[+-](?:[01]\d|2[0-3]):[0-5]\d)?$
Integer
numbers

Positive or negative integers

^-?\d+$
Decimal Number
numbers

Decimal numbers with optional sign

^-?\d*\.?\d+$
Percentage
numbers

Percentage values (0-100)

^(?:100(?:\.0+)?|\d{1,2}(?:\.\d+)?)%?$
Strong Password
security

Min 8 chars, uppercase, lowercase, digit, special

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

JSON Web Token format

^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$
US Phone
contact

US phone number formats

^\+?1?[-. ]?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4}$
International Phone
contact

International phone with country code

^\+(?:[0-9] ?){6,14}[0-9]$
Credit Card
financial

Visa, Mastercard, Amex, Discover

^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14}|3[47][0-9]{13}|6(?:011|5[0-9]{2})[0-9]{12})$
Alpha Only
strings

Letters only (no spaces)

^[a-zA-Z]+$
Alphanumeric
strings

Letters and numbers only

^[a-zA-Z0-9]+$
Username
strings

3-16 chars: letters, numbers, underscore, hyphen

^[a-zA-Z0-9_-]{3,16}$
Contains Whitespace
strings

Matches any whitespace character

\s
File Extension
files

Extracts file extension

\.([a-zA-Z0-9]+)$
Image File
files

Common image file extensions

\.(jpe?g|png|gif|webp|svg|bmp|ico)$
Test Pattern
Select a pattern from the list to test it