2020-08-13

re.findall()方法 re.findall(pattern,string,flag=0) 作用,掃描整個string字符串,返回所有與pattern匹配的列表 參數 pattern:正則表達式 string:在哪個字符串中進行查找 flag:匹配模式 返回 返回string中與pattern匹配的結果列表 示例,rs = re.findall(‘a.+bc’,‘a\nbc’,re.DOTA
相關文章
相關標籤/搜索
本站公眾號
   歡迎關注本站公眾號,獲取更多信息