Created
August 1, 2013 15:39
-
-
Save mapkyca/6132553 to your computer and use it in GitHub Desktop.
Strip email replies from an email message body. Note, this regex is simplistic, since stripping replies reliably is a whole world of hurt.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Try simple regex, strip quoted (>) replies from an email | |
return preg_replace('/(^\w.+:\n)?(^>.*(\n|$))+/mi', '', $message); | |
// Try simple regex, strip replies from email using > | |
return preg_replace('/(^\w.+:\n)?(^>.*(\n|$))+/mi', '', $message); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment