python re的findall和finditer
2018-02-21 17:06
471 查看
记录一个现象:
今天在写程序的时候,发现finditer和findall返回的结果不同。一个为list,一个为iterator。
红色箭头的地方,用finditer写的时候,print(item.group())时,返回这样的结果。
而用findall写的时候,结果是这样子。
查了资料才明白,参考:http://blog.csdn.net/wali_wang/article/details/50623991
今天在写程序的时候,发现finditer和findall返回的结果不同。一个为list,一个为iterator。
红色箭头的地方,用finditer写的时候,print(item.group())时,返回这样的结果。
而用findall写的时候,结果是这样子。
查了资料才明白,参考:http://blog.csdn.net/wali_wang/article/details/50623991
相关文章推荐
- python3 正则匹配 re.split,re.finditer,re.findall 方法
- Python3正则匹配re.split,re.finditer及re.findall函数用法详解
- python re.findall 遇到的小问题
- python爬虫笔记之re.compile.findall()
- Python正则表达式学习(5)——re.findall()
- python error之re模块的findall与match错误
- Python正则表达式---全部能匹配的子串迭代器finditer及findall及以中文匹配部分中文
- Python3的re.match()、re.search()和re.findall()
- 7 Python Regular Expressions Examples – Re Match Search FindAll
- 【整理】Python中的re.search和re.findall之间的区别和联系 + re.finall中带命名的组,不带命名的组,非捕获的组,没有分组四种类型之间的区别
- python中正则表达式 re.findall 用法
- Python中的re.search和re.findall之间的区别2
- 【Python】正则表达式 re.findall 用法
- python正则表达式 re (二)findall与finditer
- Python3的re.match()、re.search()和re.findall()
- python re.findall()使用2个模型查找返回包含tuple的list
- python 正则表达式 之re.findall
- Python中的re.search和re.findall之间的区别
- python re.findall 包含括号的问题
- Python使用re.findall返回一个查询的列表