Month Number Regular Expression

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: