Regex expiration date MM/YYYY -
this question has answer here:
i'm trying find regex pattern validate credit card expiration date. format mm/yyyy
00/0000 -> not accepted 02/0000 -> not accepted 00/2016 -> not accepted 02/2016 -> accepted 12/2016 -> acceptedenter code here 13/2016 -> not accepted
the 2 number of year must 20 year doesn't under 2016 ideas?
you want this -- not it's solution:
(0[1-9]|10|11|12)/20[0-9]{2}$
ps: requires -e
tag if being used grep
.
pps: answer assumes expiration date @ end of line.
ppps: if want explanation, give me ring. :)
Comments
Post a Comment