$re = '/(?P<Timestamp>\b(?:Jan(?:uary)?|Feb(?:ruary)?|Mar(?:ch)?|Apr(?:il)?|May|Jun(?:e)?|Jul(?:y)?|Aug(?:ust)?|Sep(?:tember)?|Oct(?:ober)?|Nov(?:ember)?|Dec(?:ember)?)\b[\s+\w+]+[\w+:?]+)\s+(?<SourceIP>[\d+\.?]+)\s+(?P<EventID>%PIX-6-\d+):\s+(?P<EventMessage>Built (inbound|outbound) UDP connection\s+\d+) for (?P<OutsideIP>.*?) to (?P<InternalIP>.*)/';
$str = 'Jul 25 23:56:17 210.56.128.109 %PIX-6-302015: Built outbound UDP connection 71946319 for Outside:HQ_dns_server2/53 (HQ_dns_server2/53) to Corp-DMZ:proxy2/20660 (proxy2/20660)
Jul 25 23:56:11 210.56.128.109 %PIX-6-302015: Built inbound UDP connection 71946248 for Outside:192.168.26.44/123 (192.168.26.44/123) to Internal:GAIA_172.20.8.11/123 (GAIA_172.20.8.11/123)
';
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