preg_replace arguments to remove mailing list footer

Hi All;

I need the expression to do a preg_replace on this:

--
MySQL General Mailing List


I need to remove it from the bottom of emails, I want to remove everything below this line from the email I am processing. 500 points because I want to take care of this tonite.
LVL 17
SqueebeeAsked:
Who is Participating?
 
andreifConnect With a Mentor Commented:
$text = preg_replace('/MySQL General Mailing List/i','', $text)

I wonder if those "--" are part of the string? then try

$text = preg_replace('/\-\-[\n\r]+MySQL General Mailing List/is','', $text)
0
 
Michael701Commented:
like this?

$pos = strpos ($mystring, "MySQL General Mailing List");
if ($pos)
{
  $mystring = substr($mystring, 0, $pos)
}
0
 
SqueebeeAuthor Commented:
While I am sure that will work, I am trying to pass an argument to an existing app, and the existing app uses preg_replace. As such I need a preg_replace expression.
0
 
NetGrooveCommented:


$text = preg_replace('/MySQL General Mailing List[.\n\r]*/i','', $text);

0
 
SqueebeeAuthor Commented:
Thanks andreif I will give that a try and get back to you.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.