I am setting up this example Perl snippet to validate for months in a date:
Some scenarios I want to accept are:
MM M
#!/usr/bin/perl use str
If you really like to use regex, you need to put ^ and $, like
"^(0?[1-9]|1[012])$"
it will not match 13, 14 ....