User avatar
User Name
user@example.com

Regex Tester

Test and debug your regular expressions in real-time

Test Regular Expressions

Enter your regular expression and test string below to see the matches in real-time. You can also select various regex flags to modify the behavior.

/ /

Results

Enter a regex pattern and test string, then click "Test Regex" to see results.

Common Regex Patterns

Email

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

URL

/^(https?:\/\/)?([\da-z.-]+)\.([a-z.]{2,6})([/\w .-]*)*\/?$/

Phone Number (US)

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

Date (MM/DD/YYYY)

/^(0[1-9]|1[0-2])\/(0[1-9]|[12][0-9]|3[01])\/(19|20)\d{2}$/

IP Address

/^(?:(?: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]?)$/

Password (Strong)

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