I have a string, let's say an email From field:
str1 = "Name <emailaddress@example.com>"
(or perhaps with another format, the thing is that inside of str an email address is found...)
And I have a list of addresses:
lst = ["email1@example.com", "email2@yahoo.com", "email3@mail.com", "emailaddress@example.com"]
What is the most pythonic way to search if the part of str with the email address is one of the members on lst ?
In the example, the email part of str1 is part of lst, but for:
str2 = "Another email emailexample@domain.com"
it is not...
Also,
str3 = "Example email1@example.com"
would match because email1@example.com is in the list, no matter there's no '<' '>' surrounding the email addres...