Discuss / Python / 作业

作业

Topic source

str1='someone@gmail.org' str2='bill.gates@microsoft.com' st=re.match(r'^(\w.)@(\w).com|org$',str2) if st: print('Ok') else: print('False') name='<Tom Paris> tom@voyager.org' pp=re.match(r'^<(\w\s\w)>\s(\w)@(\w).org|com',name) print(pp.groups())


  • 1

Reply