//work1 def is_valid_email(addr): r_addr = re.match(r'([0-1a-zA-Z.]*)@([a-z.]*)', addr) if r_addr is None: print('false') return False else: print(r_addr.groups()) return True //work2 def name_of_email(addr): rm = re.match('<(\w+\s+\w+)>', addr) if rm is None: return re.match('(\w+)@(\w+)', addr).group(1) else: return rm.group(1)
Sign in to make a reply
Roger_R36