0

I am looking for a regex to exclude mail headers in a given document. Not sure how it has to be done

I tried creating a reg ex to identify an address following From field, But the email address could be more and i do not have an option to create a separate reg-ex.

"From: lastname, Firstname (Contractor) 
Sent: Tuesday, December 24, 2013 10:52 AM
To: lastname, Firstname (Contractor) or myname@gmail.com
Cc: lastname, Firstname (Contractor); lastname, Firstname (Contractor) ; lastname, Firstname (Contractor) ;lastname, Firstname (Contractor) 
Subject: RE: Subject of the mail "

It will be helpful if you could share a reg-x for this scenario.

MKII
  • 892
  • 11
  • 36
  • The header is everything up to the first blank line. So search for two newlines in a row. – Barmar Dec 24 '13 at 07:18
  • If you say what language you're using, someone may be able to be more detailed. But most languages make it easy to do that. – Barmar Dec 24 '13 at 07:19
  • @Barmar sir i love u, bcoz of ur efforts and help :) –  Dec 24 '13 at 07:24
  • Those are not proper RFC5322 headers, though; many details are off, such as the semicolon (pro comma) between Cc: recipients, and the wonky nonstandard Sent: with an ad hoc date format (pro Date: header), and the lack of any email addresses. Where do these headers come from? (Microsoft Bob?) – tripleee Dec 24 '13 at 07:27

0 Answers0