I am currently working on a textfield where users can enter their credit card expiry date in the format mm/yy. To ensure the validity of this input, I have implemented JavaScript validation using regular expressions. Here is an example of what I have tried:
var s = "11/12";
/^(0[1-9]|1[0-2])\/\d{2}$/.test(s);
While the above expression successfully validates the month, it allows for incorrect years such as 00, 12, and 17. How can I modify the regular expression to also validate the year?