e = '<Tom Paris> tom@voyager.org' m = re.match(r'^(<\w+\s\w+>)\s+(\w+)@(\w+.\w+)$',e) if m!=None: print('Email is ok! The Email is :',m.group(0)) else: print('Email is failed! Please check it again. Your input is:\n',e)
Sign in to make a reply
林林1292
e = '<Tom Paris> tom@voyager.org' m = re.match(r'^(<\w+\s\w+>)\s+(\w+)@(\w+.\w+)$',e) if m!=None: print('Email is ok! The Email is :',m.group(0)) else: print('Email is failed! Please check it again. Your input is:\n',e)