This regex works in pythex, but not in python 3.6. I am not sure why:
Code in python:
import re
test = '105297 003 002394 o 0000 20891 0.00 1'
pattern = r"(?P<pun1>\d{3})\s+(?P<pun2>\d{6})(\s+(?P<pun3>[01oO])(\s+(?P<pun4>\d{4}))?)?\s.*\s(?P<amt>\d+\.\d\d)\s"
match = re.match(pattern, test, re.IGNORECASE)
match is None
True
I haven't been able to figure out why it works in pythex but not in python interpreter.