I am parsing out some emails. Mobile Mail, iPhone and I assume iPod touch append a signature as a separate boundary, making it simple to remove. Not all mail clients do, and just use (--( as a signature delimiter.
I need to chop off the (--( from a string, but only the last occurrence of it.
hello, this is some email copy-- check this out
I thougth about splitting on (--(, removing the last part, and I would have it, but explode() and split() neither seem to return great values for letting me know if it did anything, in the event there is not a match.
I can not get preg_replace to go across more than one line. I have standardized all line endings to \n
What is the best suggestion to end up with "hello, this is some email copy-- check this out", taking not, there will be cases where there is no signature, and there are of course going to be cases where I can not cover all the cases.
posted date: 2009-04-07 04:17:00