Fairly simple problem that I’ve been scratching my head with regex patters for too long.
Problem: Determine if a message is a forwarded message (Subject: FT.*). If so, strip off everthing above (and including) that line and return the rest.
Constraints: Must work for both Windoz and Unix newlines (‘rn’ and ‘n’ respectively).
I Have:
[CODE]
$fwdPat = ‘/.*subject:[ ]*fw.*[\r\n](.*)/msi’;
if( preg_match($fwdPat, $msgBuf, $results) ) {
$msgBuf = $results[1];
}
return($msgBuf);
I get the match, but everything is returned in the pattern match ($result[0]) and nothing in the substring match ($result[1]).
I’m sure it’s simple, I just can’t see it.
Thanks in advance for any pointers.
tony