re_mail=re.compile(r'[a-zA-Z][\w\.]*@[a-zA-Z0-9]+\.com') def is_valid_email(addr): if re_mail.match(addr): return True
re_mail=re.compile(r'([\w<> ]*?)([a-zA-Z][\w\.]*?)@[a-zA-Z0-9]+\.[com|org]') def name_of_email(addr): result = re_mail.match(addr) if result.group(1): return re.match(r'<([\w ]+)>', result.group(1)).group(1) else: return result.group(2)
Sign in to make a reply
天清濏等烟雨