An All-in-one regular expression to valid dates in mm/dd/yyyy, mm-dd-yyyy, or mm.dd.yyyy format.
/^(?:(?:(?:0?[13578]|1[02])(\/|-|\.)31)\1|(?:(?:0?[1,3-9]|1[0-2])(\/|-|\.)(?:29|30)\2))(?:(?:1[6-9]|[2-9]\d)?\d{2})$|^(?:0?2(\/|-|\.)29\3(?:(?:(?:1[6-9]|[2-9]\d)?(?:0[48]|[2468][048]|[13579][26])|(?:(?:16|[2468][048]|[3579][26])00))))$|^(?:(?:0?[1-9])|(?:1[0-2]))(\/|-|\.)(?:0?[1-9]|1\d|2[0-8])\4(?:(?:1[6-9]|[2-9]\d)?\d{2})$/
View Details
A regular expression to match and validate a 4-digit year (from 1900 to 2099).
/^(19|20)[\d]{2,2}$/
View Details
A regular expression to match a time (mm:ss) limited to 60 minutes.
/^(([0]?[0-5][0-9]|[0-9]):([0-5][0-9]))$/
View Details
A regular expression to match RFC 2822 timestamps.
/^(?:(Sun|Mon|Tue|Wed|Thu|Fri|Sat),\s+)?(0[1-9]|[1-2]?[0-9]|3[01])\s+(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s+(19[0-9]{2}|[2-9][0-9]{3})\s+(2[0-3]|[0-1][0-9]):([0-5][0-9])(?::(60|[0-5][0-9]))?\s+([-\+][0-9]{2}[0-5][0-9]|(?:UT|GMT|(?:E|C|M|P)(?:ST|DT)|[A-IK-Z]))(\s+|\(([^\(\)]+|\\\(|\\\))*\))*$/
View Details
A set of regular expressions to match ISO 8601 years, weeks, dates, times, and datetimes with optional time zone.
/^(-?(?:[1-9][0-9]*)?[0-9]{4})-(1[0-2]|0[1-9])-(3[01]|0[1-9]|[12][0-9])(Z|[+-](?:2[0-3]|[01][0-9]):[0-5][0-9])?$/
View Details
A regular expression to match a 12-hour time with AM/PM after it.
/^ *(1[0-2]|[1-9]):[0-5][0-9] *(a|p|A|P)(m|M) *$/
View Details
A regular expression for month that can be used to validate month input.
^((0[1-9])|(1[0-2]))$
View Details
A Regular Expression to match and validate Credit Card Expiration Date in MM/YY format.
/^(0[1-9]|1[0-2])\/?([0-9]{4}|[0-9]{2})$/
View Details
A regular expression to match an EU date format: DD-MM-YYYY.
/^(((((0[1-9])|(1\d)|(2[0-8]))-((0[1-9])|(1[0-2])))|((31-((0[13578])|(1[02])))|((29|30)-((0[1,3-9])|(1[0-2])))))-((20[0-9][0-9]))|(29-02-20(([02468][048])|([13579][26]))))$/
View Details
A regular expression to match a Julian date in the format YYDDD.
/^([0-9]{2})(00[1-9]|0[1-9][0-9]|[1-2][0-9][0-9]|3[0-5][0-9]|36[0-6])$/
View Details