I have a couple email addresses, '[email protected]'
and '[email protected]'
.
In perl, I could take the To:
line of a raw email and find either of the above addresses with
/\w+@(tickets\.)?company\.com/i
In python, I simply wrote the above regex as '\w+@(tickets\.)?company\.com'
expecting the same result. However, [email protected]
isn't found at all and a findall on the second returns a list containing only 'tickets.'
. So clearly the '(tickets\.)?'
is the problem area, but what exactly is the difference in regular expression rules between Perl and Python that I'm missing?