I have a string, let's say an email From field:
str1 = "Name <[email protected]>"
(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 = ["[email protected]", "[email protected]", "[email protected]", "[email protected]"]
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 [email protected]"
it is not...
Also,
str3 = "Example [email protected]"
would match because [email protected] is in the list, no matter there's no '<' '>' surrounding the email addres...