Can someone help me with a regex? Im trying to ignore everything before a / such as http://www.domain.com/whatever/pic.gif. I want to remove everything before the last / (regardless of how many / there may be) so I am only left with only pic.gif
Jul 30, 2001, 1:08 PM
Veteran (19537 posts)
Jul 30, 2001, 1:08 PM
Post #2 of 4
Views: 2998
Regex to get pic1.gif....
or...
$img = $1;
}Installations:http://www.wiredon.net/gt/
Code:
$url = "http://www.domain.com/bla/pic1.gif";Code:
$url =~ s/^.+(\w+\.\w+)$/$1/;Code:
if ($url =~ /(\w+\.\w+)$/) { $img = $1;
}