ConditionRegEx Pattern

By October 7, 2016Services

ConditionRegEx Pattern

Numbers only^[0-9]*$

Email^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$

Time in 12-hour format (hh:mm)^(1[0-2]|0?[1-9]):([0-5]?[0-9])$

Time in 12-hour format (hh:mm:ss)^(1[0-2]|0?[1-9]):([0-5]?[0-9]):([0-5]?[0-9])$

Range of 1-12 (hour, month)^(1[0-2]|[1-9])$

Range of 1-24 (hour):^(2[0-4]|1[0-9]|[1-9])$

Range of 0-59 (minute, second):^[1-5]?[0-9]$

Range of 1-31 (day of month):^(3[01]|[12][0-9]|[1-9])$

Range of 0-100 (percentage):^(100|[1-9]?[0-9])$

SSN^(?!000|666)(?:[0-6][0-9]{2}|7(?:[0-6][0-9]|7[0-2]))-(?!00)[0-9]{2}-(?!0000)[0-9]{4}$

Name (alphabetical characters and spaces only)^[a-z\s]+$

Postal Address[a-zA-Z\d\s\-\,\#\.\+]+Zip Code (US)^\d{5,6}(?:[-\s]\d{4})?$

Date ( mm/dd/yyyy or mm-dd-yyyy )((0[1-9])|(1[0-2]))[\/-]((0[1-9])|(1[0-9])|(2[0-9])|(3[0-1]))[\/-](\d{4})URLhttps?\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,}Limit characters (eg: 140)^[\s0-9A-Za-z!@.,;:'”?-]{1,140}$

Words limit (10 – 15 words)^[-\w]+(?:\W+[-\w]+){9,14}\W*$

Leave a Reply