We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Validating and Parsing Email Addresses
Validating and Parsing Email Addresses
Sort by
recency
|
343 Discussions
|
Please Login in order to post a comment
BTW, if you want to do it with regex, this is one way:
import email.utils, re for i in range(int(input())): name, e=input().split() l=email.utils.parseaddr(e) if re.search(r"^a-zA-Z{1,}@([A-Za-z]{1,}).[A-Za-z]{1,3}$",l[1]): print(name, e)
Whitout email.utils -->