首页 > 其他 > 详细

re.match和re.search的区别

时间:2020-03-03 16:19:02      阅读:63      评论:0      收藏:0      [点我收藏+]
re.match(pattern, string, flags)    #Only beginning of the string
re.search(pattern, string, flags)    #Searches everywhere of the string
import re

string = python crash course
m = re.match(y, string)
print("Matching result: ", m)

s = re.search(y, string)
print("Searching result: ", s)

 

re.match和re.search的区别

原文:https://www.cnblogs.com/dennisD/p/12402338.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!