python正则表达式匹配邮箱
表达式:
//包含大小写字母,下划线,阿拉伯数字,点号,中划线
[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)
使用:
import re
pattern = re.compile(r"[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(?:\.[a-zA-Z0-9_-]+)")
strs = '123@@345.com test@test.com sdfs_sf@@@_123 '
result = pattern.findall(strs)
print(result)