Regex

Short for regular expression, regex is a tool for finding patterns within a string.

the most useful regex use cases are to validate user input or to search through a large text.

in this website we gathered the most useful regex use cases for you, just copy and paste it into your code.

you can search for topics to find the relevant regex for your problem good luck!


* Notice that all the regular expressions in this site was tested by the Javascript Match method and may not work with other programming languages!

Select regex by topic

Regex for email validation

Result:

Only english letters regex

Result:

Only english letters and numeric characters regex

Result:

Regex for ipv4 validation

Result:

Regex for ipv6 validation

Result:

Regex for ipv4 and ipv6 validation

Result:

Regex for strong password - minimum of eight characters, must have uppercase letters, lowercase letters and numbers (you can change the length of the password by changing the last digit in the regex ({8,} --> {10,}))

Result:

Regex for stronger(complex) password - minimum of eight characters, must have uppercase letters, lowercase letters numbers and special characters (you can change the length of the password by changing the last digit in the regex ({8,} --> {10,}))

Result:

Regex for date validation - dd/mm/yyyy || dd-mm-yyyy || dd.mm.yyyy

Result:

Regex for date validation - mm/dd/yyyy

Result:

Regex for date validation - (dd/mmm/yyyy || dd-mmm-yyyy || dd.mmm.yyyy || dd/mm/yyyy || dd-mm-yyyy || dd.mm.yyyy) examples: (21/Jun/2002 || 21-jun-2002 || 21.JUN.2002 || 21/06/2002)

Result:

Regex for time validation - HH:MM - 24 hours

Result:

Regex for time validation - HH:MM:SS - 24 hours

Result:

Regex for SSN (USA social security number) - 123-45-6789 || 123456789 / (follows the ssn rules)

Result:

Only hebrew letters regex

Result:

Only chinese letters regex

Result:

Only japanese letters regex

Result:

Only arabic letters regex

Result:

Regex for URL validation - will match: (http || https || www) examples: (www.google.com || http://google.com || https://google.com), will not match: google.com

Result:

Regex for URL validation with no protocol (http / https)- will match:(www.google.com || google.com), will not match: (https://google.com)

Result:

Regex for youtube video url validation

Result:

Regex for visa credit card validation

Result:

Regex for mastercard credit card validation

Result:

Regex for dinars club credit card validation

Result:

Regex for american express credit card validation

Result: