I need a regular expression to validate credit card expiry date. Note that the format of the \"date\" is MM/YY where YY is the year without century and MM is the month (from
This regexp does the job:
(0[1-9]|1[0-2])\/[0-9]{2}
Note that it has a capturing group, depending on your regexp engine you can make it non-capturing like this:
(?:0[1-9]|1[0-2])\/[0-9]{2}