findall()方法的作用:
匹配查找内容,返回包含结果的列表。
使用方式:
import re
title = re.findall('(.*?) ',myhtml)上述给大家演示的是关于标题匹配查找的方式,大家还可以看下以下案例。
请使用findall()函数搜索所有的"python"字符串
import re
s = "python2.7,python3.x都是python的版本,只不过python2.7不再维护了"
s = re.findall("python", s)
print(s)