$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)?)\s+\d+\s+\d+:\d+:\d+)\b\s+(?P<FW_ip_addr>\d+\.\d+\.\d+\.\d+)\s+(?P<Event_id>%\w+-\d+-\d+):\s+(?P<Event_message>Teardown ICMP connection for faddr)\s+(?P<foreign_ip_addr>.*)\s+gaddr\s+(?P<global_ip_addr>.*)\s+laddr\s+(?P<local_ip_addr>.*)/';
$str = 'Jul 25 23:56:11 210.56.128.109 %PIX-6-302021: Teardown ICMP connection for faddr 192.168.20.161/1 gaddr GAIA_172.20.8.11/0 laddr GAIA_172.20.8.11/0
Jul 25 23:56:33 210.56.128.109 %PIX-6-302021: Teardown ICMP connection for faddr Thetis2/41817 gaddr 210.56.128.109/0 laddr 210.56.128.109/0
';
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