$re = '/\| server[ \s]+= (.*)\/(.*)\n/';
$str = '[ 10.0.7.58/34002 -> 54.239.34.168/80 (http response) ]-
|
| server = 54.239.34.168/80
| app = ???
| lang = none
| params = none
| raw_sig = 1:Date,Server,x-amzn-RequestId=[b168af90-ba17-11e5-bc01-df91e7ac5819],Content-Type,?Content-Length,?Vary,Keep-Alive=[timeout=2, max=7],Connection=[Keep-Alive]:Accept-Ranges:Server
|';
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