37,720
社区成员
发帖
与我相关
我的任务
分享
import re
print re.findall('car', 'Carry the bar to the car', re.I)
print re.finditer('car', 'Carry the bar to the car', re.I).next().groups()
['Car', 'car']
()
import re
print(re.findall('car', 'Carry the bar to the car', re.I))
for m in re.finditer('car', 'Carry the bar to the car', re.I):
print(m.group(0))