What is the regular expression for validating a month with the leading zero?
Passes regular expression:
01,02,03,04,05,06,07,08,09,10,11,12
Fails regular expression:
1, 00, 13 and up.
/^(0[1-9]|1[0-2])$/
/^01|02|03|04|05|06|07|08|09|10|11|12$/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With