I am trying to extract all the sentence containing a specified word from a text.
txt="I like to eat apple. Me too. Let's go buy some apples."
txt = "." + txt
re.findall(r"."+".+"+"apple"+".+"+".", txt)
but it is returning me :
[".I like to eat apple. Me too. Let's go buy some apples."]
instead of :
[".I like to eat apple., "Let's go buy some apples."]
Any help please ?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…