📌  相关文章
📜  正则表达式查找所有匹配的单词索引 - 汇编代码示例

📅  最后修改于: 2022-03-11 14:48:10.494000             🧑  作者: Mango

代码示例1
import re
sentence = input("Give me a sentence ")
word = input("What word would you like to find ")
for match in re.finditer(word, sentence):
    print (match.start(), match.end())