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 = \".\"
In [3]: re.findall(r"([^.]*?apple[^.]*\.)",txt) Out[4]: ['I like to eat apple.', " Let's go buy some apples."]