A regular expression for month number that can be used to validate month input.
^((0[1-9])|(1[0-2]))$
Matches
- 01
- 10
- 12
Non-matches:
- 1
- 2
- 13
See Also:
- Date (dd/mm/yyyy) Regular Expression
- 12-Hour Time (hh:mm:ss) Regular Expression
- 24-Hour Time (HH:mm:ss) Regular Expression
- Regular Expression For Year
- Regular Expression To Match Month Name
- Regular Expression To Match Names Of The Days Of The Week
- Regex To Match A Valid Day In A Date String