摘要: re.match()函数只检测RE是不是在string的开始位置匹配re.match()只有在0位置匹配成功的话才有返回,如果不是开始位置匹配成功的话,match()就返回none # 语法 # re.match(pattern, string, flags=0) # eg_v1 import re match = "https://www.python.org" print (re.matc... 阅读全文
posted @ 2017-04-18 12:02 xie仗剑天涯 阅读(2262) 评论(0) 推荐(0) 编辑
摘要: 正则 re.findall 的简单用法(返回string中所有与pattern相匹配的全部字串,返回形式为数组)语法: findall(pattern, string, flags=0) import rePython 正则表达式 re findall 方法能够以列表的形式返回能匹配的子串# print (help(re.findall))# print (dir(re.findall))f... 阅读全文
posted @ 2017-04-18 11:57 xie仗剑天涯 阅读(289152) 评论(0) 推荐(7) 编辑