I'm trying to put up a regex to remove extra keywords from the mail subjects, added generally by mail composers like Fwd, Re: But not able to come up with a regex that can satisfy all these scenarios.
Fwd : Re : Re: Many
Re : Re: Many
Re: Re: Many
Re: Many
Re: Many
RE: Presidential Ballots for Florida
RE: (no subject)
Request - should not match anything
this is the subject
Re: Fwd
I tried with this regex in Java:
subject.replaceAll("^.{0,3}:\s", "");
but this removes only the first match found. Any regex if it can satisfy most of the common scenarios, not all the above will be a great help as well. I found some regex for Python, but converting them into Java is quite a pain. Any help is appreciated.