import re
match1=r'^([0-9a-zA-Z.]?)(\@)([0-9a-zA-Z.]?)(.com)$' m1=re.match(match1,'bill.gates@gmail.com').groups()
match2=r'^\<([a-zA-Z])>([0-9a-zA-Z.]?)(\@)([0-9a-zA-Z.]*?)(.com)$'
match3=r'^\<([a-zA-Z])>([0-9a-zA-Z.]?)(\@)([0-9a-zA-Z.]*?).com$'
m2=re.match(match2,'<zhouzelin>Zelzhou@163.com').groups() m3=re.match(match3,'<zhouzelin>Zelzhou@163.com').groups()
print(m1) print(m2) print(m3)
Sign in to make a reply
泽林--安静读书
import re
match1=r'^([0-9a-zA-Z.]?)(\@)([0-9a-zA-Z.]?)(.com)$' m1=re.match(match1,'bill.gates@gmail.com').groups()
match2=r'^\<([a-zA-Z])>([0-9a-zA-Z.]?)(\@)([0-9a-zA-Z.]*?)(.com)$'
match3=r'^\<([a-zA-Z])>([0-9a-zA-Z.]?)(\@)([0-9a-zA-Z.]*?).com$'
m2=re.match(match2,'<zhouzelin>Zelzhou@163.com').groups() m3=re.match(match3,'<zhouzelin>Zelzhou@163.com').groups()
print(m1) print(m2) print(m3)