You are viewing a single comment's thread. Return to all comments →
import re import email.utils n = int(input()) pattern = r'^[a-z][\w\-_.]*[@][a-z]+[.][a-z]{1,3}$' for i in range(n): name, address = email.utils.parseaddr(input()) if re.match(pattern,address): print(email.utils.formataddr((name, address))) else: continue
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 →