something like
$tag="<img src=blah.jpg alt=blah>";
if(preg_match("/img[ \t\]*=[ \t\n]*[\"]?(.*\..*)[\"]?/i",$tag,$matches))
print_r($matches);
else
echo "no match";
should work, i just threw that together- it will match the whole src=blah.jpg alt=blah.jpg, so youll have to trim that 🙂