Test your regular expressions with real-time matching, explore common patterns, and learn regex syntax. Perfect for developers, data analysts, and anyone working with text processing.
No matches found
Validates email addresses
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$
US phone number format
^\+?1?[-.\s]?\(?([0-9]{3})\)?[-.\s]?([0-9]{3})[-.\s]?([0-9]{4})$
Validates HTTP/HTTPS URLs
^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._\+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_\+.~#?&//=]*)$
Strong password with uppercase, lowercase, and number
^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d@$!%*?&]{8,}$
Visa and MasterCard numbers
^(?:4[0-9]{12}(?:[0-9]{3})?|5[1-5][0-9]{14})$
ISO date format
^\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])$
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]?)$
CSS hex color codes
^#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})$
Username with 3-20 characters
^[a-zA-Z0-9_]{3,20}$
US SSN format
^\d{3}-\d{2}-\d{4}$
.
Matches any character except newline^
Matches start of string$
Matches end of string*
Matches 0 or more of the preceding element+
Matches 1 or more of the preceding element?
Matches 0 or 1 of the preceding element|
OR operator - matches either pattern[]
Character class - matches any character inside[^]
Negated character class()
Grouping - creates a capture group\d
Matches any digit (0-9)\w
Matches word characters (a-z, A-Z, 0-9, _)\s
Matches whitespace characters\b
Word boundaryg
GlobalFind all matches, not just the first
i
Case InsensitiveMatch regardless of case
m
Multiline^ and $ match line breaks
s
Dot All'.' matches newline characters
u
UnicodeHandle Unicode characters properly
y
StickyMatch only at the last index
Regular expressions are powerful patterns used to match, search, and manipulate text. They are essential tools for developers, data analysts, and anyone working with text processing. Our free regex validator helps you test and debug regular expressions in real-time.
Common use cases include email validation, phone number formatting,URL validation, password strength checking, and data extractionfrom text documents.
Validate email addresses, phone numbers, and user input in forms
Find and replace patterns in text documents and code files
Extract specific information from log files and system outputs