I'm working on a regular expression but I just can't make it work.
With a text like this:
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ultricies congue feugiat.
Tom wrote:
> blablabla
> this is very interesting
> blabla blabla
> I ate a apple yesterday
> this is very interesting
> blabla blabla
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc ultricies congue feugiat.
I Would like to match the whole part of the text that starts with "Tom wrote:" and that ends with last line starting with a ">" in order to remove it and to get only the 2 lorem ipsum sentences.
I don't know if I'm clear enough...
Edit: I was thinking about a regexp that match everything that starts with "\w wrote: " and that stops when it matches a newline followed by a char that is not a ">"
Edit2: Found a solution :
\w+ wrote:(\n>[^\n]*)*