python爬虫02 re模块与正则表达式

来源:互联网 发布:excel数据预测方法 编辑:程序博客网 时间:2024/05/22 03:43

import re

stl="string hdsk"

pa=re.compile(r'string')

ma=pa.match(stl)

print ma.group()

结果匹配到string




0 0
原创粉丝点击