http://www.perlmonks.org?node_id=1014054


in reply to Re^3: Regex to match non image urls
in thread Regex to match non image urls

That said, what you are doing is conceptually broken. It is perfectly valid for an image on the web to have a URL ending with ".cgi", ".php", or even ".html". Whether something is an image or not is decided by its HTTP Content-Type header, not by the last few characters of the URL.

I couldn't agree more, sir.

That being said, I like the elegance of your code snippet.