$re = '/"GET \S+\/\K\S+\.\w{1,3}\b/m';
$str = 'h24-71-249-14.ca.shawcable.net - - [07/Mar/2004:22:29:13 - 0800] "GET /icons/gnu-head-tiny.jpg HTTP/1.1" 200 3049
h24-71-249-14.ca.shawcable.net - - [07/Mar/2004:22:29:13 - 0800] "GET /icons/gnu-head-tiny HTTP/1.1" 200 3049';
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