I was trying to use the solution provided in the following link to parse email responses programmatically: Parse email content from quoted reply
it works fine in most cases except for gmail and outlook. It also picks the sender line:
On Sun, Mar 31, 2013 at 10:57 AM, < abc@domain.com> wrote:
I do not understand regex much, but the following one should have parsed it correctly:
new Regex("From:\\s*" + Regex.Escape(address), RegexOptions.IgnoreCase)
new Regex("\\n.*On.*(\\r\\n)?wrote:\\r\\n", RegexOptions.IgnoreCase | RegexOptions.Multiline)
Sample Data:
Do read it.\r\n\r\n\r\nOn Sun, Mar 31, 2013 at 10:57 AM, <\r\n abc@domain.com > wrote:\r\n\r\n>
Expected Outcome:
Do read it.
Current Outcome:
Do read it. On Sun, Mar 31, 2013 at 10:57 AM, wrote: