Trying to find pattern matches based on the following conditions:
- Length of string is 5 characters
- Char [0] = Letter/Number
- Char [1] = Letter
- Char [2-4] = Number
I don't understand why "22222" works for this expression?
p = r'(\w|\d)(\w)(\d){3,}'
m = re.match(p, "AA012") # Works as expected
--> 'AA012'
m = re.match(p, "1A222") # Works as expected
--> '1A222'
m = re.match(p, "22222") # Does NOT work as expected!
--> '22222'
What am I missing in my regex expression syntax?