$re = '/sm-mta\[.*\]:\s(?<qid>.*?):/m';
$str = 'Feb 19 00:05:04 smtp2 sm-mta[28608]: l1J652ZW028608: from=<dsbugeyed@example.org>, size=15433, class=0, nrcpts=1, msgid=<001001c75437$5633fa90$06aeb57c@samsungtkb30u2>, proto=SMTP, daemon=MTA, relay=[58.78.156.175]';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 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