I'm having trouble implementing a regex pattern in python. My expression works in on https://regexr.com/ but I can't get it to work in python.
Here is my expression: [abcd][(]\d+[)]|(ab)[(]\d+[)]|(abcd)[(]\d+[)]
I want to find and return instances a(\d+), b(\d+), c(\d+), d(\d+), ab(\d+), or abcd(\d+)
expressions = re.findall(r"[abcd][(]\d+[)]|(ab)[(]\d+[)]|(abcd)[(]\d+[)]",line)
print(expressions)
I think it might be working because when I have something in the string that should match the pattern I get [('', '')] as my output instead of []
Any thoughts?