menu

Frequently used Regular Expressions

Use Regular Expressions on a Text Line to validate the data. For example:

Input Mask forces the data to be input into the field in the matching conditions set. 
Validation Regex delivers an error on the field if the data doesn't match the conditions set.

Condition

Explanation

Regex

Email

This regex matches any string that consists of a username, followed by an @ symbol, followed by a domain name, followed by a dot, followed by a top-level domain. The username can contain letters, numbers, periods, underscores, or hyphens. The domain name can contain letters, numbers, periods, or hyphens. The top-level domain can contain two or more letters.

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

Phone

This regex is used to match a specfic pattern of text, representing phone numbers in the format "###-###-####".

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

Credit Card

This regex matches any string that consists of 16 digits. The digits can be any number from 0 to 9.

^\d{16}$

Credit Card Expiry

This regex is designed to match a specific pattern of text, that represent dates in the format "MM/DD" where MM is the month (01 to 12) and DD is the day (22 to 39).

^(0[1-9]|1[0-2])\/(2[2-9]|3[0-9])$

Currency Code

This regex matches any string that consists of three uppercase letters.

^[A-Z]{3}$

US ZIP Code

This regex matches any string that consists of five digits.

^\d{5}$

IP Address

This regex matches any string that consists of four numbers, separated by periods. Each number can be from 0 to 255.

^(\d{1,3}\.){3}\d{1,3}$

Passwords

This regex is designed to enforce certain password complexity requirements. It checks if a string contains at least one special character from the set [!@#$%^&*()_+[\]{};':"\\|,.<>/?] and is at least 8 characters long.

^(?=.*[!@#$%^&*()_+[\]{};':"\\|,.<>/?]).{8,}$


InfoLobby © 2024 Globi Web Solutions