You are viewing a single comment's thread. Return to all comments →
I managed to use both regex and email.util
import email.utils import re n = int(input()) rx = re.compile(r"^[a-zA-Z][\w\.\-_]*@[a-zA-Z]+\.[a-zA-Z]{1,3}$") emails = [email.utils.parseaddr(input()) for _ in range(n)] emails = filter(lambda x: rx.match(x[1]), emails) print(*list(map(email.utils.formataddr, emails)), sep='\n')
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 →
I managed to use both regex and email.util