So here's a sample of an e-mail I want to parse, to extract ONLY its body.
RECEIVED: 2012-11 20 09:59:24
SUBJECT: Get Boddy
--- Original Sender: Mark Twain. ---
----- Original Message -----
From: Boby Indo
To: Obum Hunter
At: 11/20 9:59:22
***NEW ISSUE SUPPORTED THROUGH UNIVERSALITY vs 104-13 on AY 3s JAN
10+BB {MYXV ABC 4116 SM MYXV YA 102-15 <DO>} | 2010/11 4.0s 4.0s
6+ BB {MYXV ABC 4132 NS MYXV YT 102-22 <DO>} | 2010 4.5s 4.5s
ABO 2006-OP1 M1 00442PAG5 19-24 p5
***SECOND SUPPORTED TRHOUGH INVERSALITY GEVINGS
10+BB {NXTW VXA 4061 SL MYXV YA 103-22 <DO>} | 11 wala 3.5s 3.5s
10+BB {NXTW VXA 12-47 SP MYXV YA 106-20 <DO>} | 22 wala 4.0s 4.0s
------------------------------------------------------------
© Copyright 2012 The Ridgly Group, Inc. All rights reserved. See
http://www.examply.html for important information disclosure.
Here's what I expect:
***NEW ISSUE SUPPORTED THROUGH UNIVERSALITY vs 104-13 on AY 3s JAN
10+BB {MYXV ABC 4116 SM MYXV YA 102-15 <DO>} | 2010/11 4.0s 4.0s
6+ BB {MYXV ABC 4132 NS MYXV YT 102-22 <DO>} | 2010 4.5s 4.5s
ABO 2006-OP1 M1 00442PAG5 19-24 p5
***SECOND SUPPORTED TRHOUGH INVERSALITY GEVINGS
10+BB {NXTW VXA 4061 SL MYXV YA 103-22 <DO>} | 11 wala 3.5s 3.5s
10+BB {NXTW VXA 12-47 SP MYXV YA 106-20 <DO>} | 22 wala 4.0s 4.0s
It would be nice it the ***lines could be eliminated as well.
And here's what I got so far (?P<header>[\S+\s]+At:.*)\n+(?P<body>[\S+\s]([\d\.\d]+[a-z]?$)) .This doesn't seem to do a good job, as it grabs the dash-lines after the last 4.0s and get stuck at at the non-ascii character ©. Thanks!
PS: I think the best approach would be to cutoff the header and the tail of the e-mail with groups. So what's left would be the body. Because the header and tail always stay the same, but the body changes on different e-mails. The solution needs not be to specific for an e-mail.
|characters looks like a starting point, although you might want to add more constraints in order to avoid stray false positives.