I have a similar problem that was discussed in this link Python extract sentence containing word, but i do not want a numeric string to end the sentence.
eg:
The apt subtitle for the binoculars will be 9015.18.1190, CTS, which provides for binoculars. The rate of duty on this will be free.
When I tried this:
import re
txt="The apt subtitle for the binoculars will be 9015.18.1190, CTS, which provides for binoculars. The rate of duty on this will be free."
define_words = 'apt subtitle'
print (re.findall(r"([^.]*?%s[^.]*\.)" % define_words,txt))
Actual output:
The apt subtitle for the binoculars will be 9015.
However the expected output is:
The apt subtitle for the binoculars will be 9015.18.1190, CTS, which provides for binoculars.
Can someone help me on achieving the expected output?