You are viewing a single comment's thread. Return to all comments →
import email.utils import re for _ in range(int(input())): n, e= map(str,input().split()) e=e.replace("<","") e=e.replace(">","") if "@"in e: l=e.split("@") if(l[0][0].isalpha()): if bool(re.search(r"[\w\,-]", l[0])): x=[] if(l[1].count(".")==1): x=l[1].split(".") if x[0].isalpha(): if x[1].isalpha() and (1<=len(x[1])<=3): d=[n,e] t=tuple(d) print(email.utils.formataddr(t))
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 →