python finditer().next()的报错 版本问题 python2.2时加入finditer() 两种写法 实测python3的写法为 str = 'this and that' res = re.finditer(r'(th\w+) and (th\w+)',str,re.I)#注意这个地方的版本问题 print(next(res).group(1))