@NogDogJul 19.2010 — #Depends on the context and what it is exactly that you want to do. For instance, if you're "screen-scraping" an HTML page for all IMG tags and their SRC attributes, I'd use the [url=http://php.net/dom]DOM extension[/url] instead of hoping I can come up with a regexp that will match every possibility without giving false positives.
@NogDogJul 19.2010 — #If they are submitting a URL, the surest way I can think of would be to use [url=http://php.net/curl]cURL[/url] to check the Content-Type header to see if it's a known image type. (Use the CURLOPT_NOBODY option to only get the header.) If you go with a regexp, you have to account not just for .jpg, .jpeg, .png, etc., but also anything that could be used to serve up an image, such as .php, .aspx, etc. that could also be non-images.