如下:
In [1]: import re In [2]: email = "1210640219@qq.com" In [3]: regular = re.compile(r'[0-9a-zA-Z.]+@[0-9a-zA-Z.]+?com') In [4]: re.findall(regular, email) Out[4]: ['1210640219@qq.com']
如下:
In [1]: import re In [2]: email = "1210640219@qq.com" In [3]: regular = re.compile(r'[0-9a-zA-Z.]+@[0-9a-zA-Z.]+?com') In [4]: re.findall(regular, email) Out[4]: ['1210640219@qq.com']
转载于:https://www.cnblogs.com/pzk7788/p/10498176.html