(([0])?[1-9])|[1][0-2]

This will allow any digit 1 through 9 and also allow it to lead with a zero. I run into a problem when I try to do 10, 11 and 12. Those cases are the ones I specified right of the alteration character (atleast, I thought?).

What am I doing wrong, why doesn't that match? Since it's an alteration, I figured it would work just like an "or" and ignore everything on the left. Am I missing something obvious?

Edit:

I just tried:
(([0])?[1-9])|1[0-2]
Same problem...