I have several email addresses, 'support@company.com'and '1234567@tickets.company.com'.
In perl, I could take a string of To:raw mail and find any of the above addresses with
/\w+@(tickets\.)?company\.com/i
In python, I just wrote the above expression as '\w+@(tickets\.)?company\.com'expecting the same result. However, support@company.comit was not found at all, and findall on the second returns a list containing only 'tickets.'. It’s so clear that '(tickets\.)?'this is a problem area, but what is the difference between the regex rules between Perl and Python that I miss?
source
share