验证email
Topic source>>> import re
>>> m_mail = re.compile(r'^(\<([a-zA-Z]+)[\s]+([a-zA-Z]+)\>)[\s]+((([a-zA-Z]+)(\.([a-zA-Z]+))*)\@([a-zA-Z]+)\.([a-zA-Z]+))$')
>>> mail = '<Tom Paris> Bill.Gates@voyager.org'
>>> m_mail.match(mail)
<_sre.SRE_Match object; span=(0, 34), match='<Tom Paris> Bill.Gates@voyager.org'>
>>> m_mail.match(mail).groups()
('<Tom Paris>', 'Tom', 'Paris', 'Bill.Gates@voyager.org', 'Bill.Gates', 'Bill', '.Gates', 'Gates', 'voyager', 'org')
- 1
我就是梦想在望
感觉这东西自己写比看别人的轻松