$re = '/([\d\s:,.-]+)\s+\w+\s+\w+QuoteHandler:(\w+)\s+Processed\s+(\d+)\s+quote\s+messages\s+for\s+service\s+([\w\s]+)\s+seq\sno:\s+(\d+)\s+Latency:\s+([-\d\.]+)\s+ms\s+exchange time:\s+([\d+\-\:\.\s]+)msg rate:\s+([\d\.]+)\s+msgs\/sec\s+Packets\s+on\s+client\s+queue:\s+(\d+),\s+packets\s+on\s+client\s+buffer:\s+(\d+),\s+packets\s+on\s+server\s+queue:\s+(\d+),\s+server\s+latency:\s+([\d\.]+)\s+ms,\s+round\s+trip\s+time:\s+([\d\.]+)\s+ms,\s+\w+\s+cnt:\s+(\d+)/';
$str = '04:46:03.318 INFO SprywareDirectFeedQuoteHandler:secondary Processed 136726 quote messages for service NSDQ Direct Feed seq no: 835534 Latency: 1 ms exchange time: 2016-05-17 04:46:03.317 msg rate: 25.157 msgs/sec Packets on client queue: 0, packets on client buffer: 0, packets on server queue: 0, server latency: 0.032 ms, round trip time: 0.103 ms, quote cnt: 136725';
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