I want to capture all the text in an email body but leave out the sign-off based on the following conditions:
IF the email ends with a sign-off such as "Regards" or "Best Regards" THEN
capture all the text in the body before the sign-off
ELSE
capture all the text in the body of the email
Please ignore case in "Regards" and "Best Regards"
IF the email ends with a sign-off such as "Regards" or "Best Regards" THEN
capture all the text in the body before the sign-off
ELSE
capture all the text in the body of the email
Please ignore case in "Regards" and "Best Regards"
Hello,
This can be done with regular expressions and also as a script-based parser. The problem is that it cannot be distinguised when the content of the email body text contains "best regards" as part of the message (rare) or the sign-off. For example:
This can be done with regular expressions and also as a script-based parser. The problem is that it cannot be distinguised when the content of the email body text contains "best regards" as part of the message (rare) or the sign-off. For example:
Hello Joe
Please, give Mary my best regards when you see her. I am very glad she helped me with bla bla bla....
Thanks,
Margareth.
Hi there,
I downloaded your program and bla bla bla bla
Best regards,
Paul Allen
Please, do not print this email. I am a very ecologist guy. bla bla bla keep our environment bla bla bla