#-*- codeing=utf-8 -*- #@Time:01/11/2022 15:00 """ 提取text中的电话号码和邮箱号 """ text='欢迎来到重庆财经职业学院,咨询热线49834729,邮箱:cqcjzs@126.com' import re l=re.compile('.*?(\w+\d+).*?(\w+.*?\d+.*?\w+)') l1=re.findall(l,text) print(l1)
#-*- codeing=utf-8 -*- #@Time:01/11/2022 15:00 """ 提取text中的电话号码和邮箱号 """ text='欢迎来到重庆财经职业学院,咨询热线49834729,邮箱:cqcjzs@126.com' import re l=re.compile('.*?(\w+\d+).*?(\w+.*?\d+.*?\w+)') l1=re.findall(l,text) print(l1)