I'm trying to create a regex to validate numbers that checks the year for leap year. here's a part of the code. for some reason this code would let number 4 8 24 28 as a valid regex.
(0{2}?)
([2468][480] | [13579][26])
pattern = re.compile (r"""
((0{2}?)([2468][480] | [13579][26]))
""", re.X)
when I left out
(0{2}?)
24 12 and everything works..
I'm using verbose so spacing shouldn't matter..
Invalid
12
24
28
16
EDIT :: Actually all is invalid now..
i don't understand why 24 is invalid and 28 is invalid this doesn't make sense at all. I appreciate your guidance.
{1}? It does nothing.