Regex Get Filename Without Extension

[php]
$url = "http://www.google.com/path/filename.jpg";
preg_match("/^.*[\/]([^\.]+)\..+/", $url, $out);
print_r($out); //Array ( [0] => http://www.google.com/path/filename.jpg [1] => filename )
[/php]