运维网's Archiver
论坛
›
Python
› python学习:python中的正则表达式函数match和search()的区别
root
发表于 2018-8-16 10:26:38
python学习:python中的正则表达式函数match和search()的区别
m.group(0)为匹配的结果
2.search函数
binary_re='*'
pattern = re.compile(binary_re)
m=re.search(binary_re,destStr)
if m:
print m.group(0)
else:
print 'not match'
页:
[1]
查看完整版本:
python学习:python中的正则表达式函数match和search()的区别