我正在尝试从文本中提取包含指定单词的所有句子。
txt="I like to eat apple. Me too. Let's go buy some apples."
txt = "." + txt
re.findall(r"\."+".+"+"apple"+".+"+"\.", txt)
但它正在返回我:
[".I like to eat apple. Me too. Let's go buy some apples."]
代替 :
[".I like to eat apple., "Let's go buy some apples."]
请问有什么帮助吗?