import re
txt = 'hello world'
def findo_bjects(word, path): return [call for call in re.finditer(word, path)]
print(findo_bjects('hello', txt))
我想知道're.finditer(('函数是在c programming
、python
还是java
中生成的?
它主要是用C.编写的
这里有一些历史:https://etutorials.org/Programming/Python.+文本+处理/章节+3.+正则表达式/3.3+标准+模块/
源代码在这里:
https://github.com/python/cpython/tree/main/Modules/_sre