$re = '/(X-PPP-Vhost: test.com)/m';
$str = 'From: alex@test.comTo: alex2 alex2@test.comSubject: testing email filterUser-Agent: Roundcube Webmail/1.4.11 Message-ID: 3907e0dede914479d42ecddb829da9a6@test.comX-Sender: alex@test.comContent-Type: text/plain; charset=US-ASCII; format=flowedContent-Transfer-Encoding: 7bitX-PPP-Message-ID: 164243412854.574642.9867894171662743646@intelligent-mahavira.ip.plesk.pageX-PPP-Vhost: test.com';
preg_match($re, $str, $matches, PREG_OFFSET_CAPTURE, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php