Micro Tools
Menu

Regex Tester

Test and debug regular expressions with live matching

Regular Expression
Enter your regex pattern
//
Global
Test String
Enter text to test against your regex
Matches (0)
Highlighted matches and capture groups
Find & Replace
Test regex replacement functionality
Common Patterns
Click to load frequently used regex patterns

Email Address

Validates email addresses

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

Phone Number (US)

Matches US phone numbers

^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$

URL

Validates HTTP/HTTPS URLs

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

IPv4 Address

Matches 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]?)$

Credit Card

Validates major credit card numbers

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

Date (YYYY-MM-DD)

Matches ISO date format

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

Hexadecimal Color

Matches hex color codes

^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$

Strong Password

At least 8 chars with uppercase, lowercase, number, and special char

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

Advertisement Space