I have a text like this:
text = "Text1.
Textt « text2 »
Some other text"
i want a regex code that is able to delete the text inside the quotes and the text before it till the dot.
so the output be like that :
text = "Text1.
Some other text"
the code am stuck into :
text= re.sub(r'\s*.*?»', '', text)
what the code actually does is delete a more than expected here's an example :
text="Text1.
Textt « text2 »
Some other text
Textt « text3 »
other text"
the output i get is like this :
text="Text1.
other text"
\..*?»as your RE, with the re.DOTALL option enabled so that.*?also matches newlines.