This is for a school project on programming and im supposed to use only the re import.
I am trying to find all sentences in a text file containing certain expression defined by a parameter and extract them into a list. Searching other posts got me halfway there by finding the dots that start and end the sentence but if there is a number with a dot in there it ruins the result.
If I have a txt : This is a text. I dont want for the result to stop in the number 990.576, I want to extract the phrase with this expression. Its not working.
search = re.findall(r"([^.]*?"+expression+"[^.]*\.", txt)
The result I'm getting is ['576, I want to extract the phrase with this expression',]
The result I want is ['I dont want for the result to stop in the number 990.576, I want to extract the phrase with this expression.']
I'm still at beginner at this, any help?