You are viewing a single comment's thread. Return to all comments →
import re import email.utils n = int(input()) pattern = re.compile(r"^([a-zA-Z][a-zA-Z0-9\_\-\.]+)\@[a-zA-Z]+\.[a-zA-Z]{1,3}$", re.IGNORECASE) for _ in range(n): name, email_address = email.utils.parseaddr(input()) if pattern.match(email_address): print(email.utils.formataddr((name, email_address)))
Seems like cookies are disabled on this browser, please enable them to open this website
Validating and Parsing Email Addresses
You are viewing a single comment's thread. Return to all comments →