I got the following code:
preg_match("#=\"?((/?[a-z0-9_-]+/?)+.(html|gif|jpg|swf))\"?#i",$line,$matches)
I'm trying to retrieve file names from an array. With this code I can get "somefile.jpg" from <img src="somefile.jpg>, cause the pattern says to match the equal sign, double quote, name and sufix.
The problem is that in my case the array could be <img src="http://www.mydomain.com/folder/subfolder/somefile.jpg">
How should the pattern be to match just "somefile.jpg"?