This will grab all characters at the end of the string that are not forward slashes. In this case, "image.jpg". This works for Unix paths and urls, as long as the url doesn't have arguments on the end. It also works nicely for relative paths, even if the file is in the current directory. (i.e. no slashes in the path.)$_ = $url; ($filename) = /([^\/]*)$/; print "filename is $filename\n";
In reply to Re: Regex simple quicky question :)
by TROGDOR
in thread Regex simple quicky question :)
by tanger
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |