Originally I wanted a regex parsing month numbers. At first I came up with the following regex:
^([1-9]{1})|(1[012])$
and it matched any positi
The alternation operator has the lowest precedence of all regex operators.
The difference between the two regular expressions, interpreted literally, is this:
( [BEGIN]([1-9]) ) OR ( (1[012])[END] )
vs
[BEGIN] ( [1-9] OR 1[012] ) [END]