天天看点

正则匹配身份证和邮箱                                                                   -------  知识无价,汗水有情,如需搬运请注明出处,谢谢!

import re

str='sfafsf,34234234234,1231313132,37132719991123463x,sdefgr54184785ds85,' \
    '4864465asf86845,372526198911233456'

con = re.findall(r'[\d]{17}[0-9xX]' , str)
for i in con:
    print('身份证:', i)


y='[email protected]@[email protected]@adfcom'
ret=re.findall('\w+@[0-9a-zA-Z]+\.com',y)
print(ret)
      

  

正则匹配身份证和邮箱                                                                   -------  知识无价,汗水有情,如需搬运请注明出处,谢谢!

                                                                   -------  知识无价,汗水有情,如需搬运请注明出处,谢谢!