Ken Perl wrote:
If I want to use regular expression to extract the charactors after
the last '/' in the url, but below regexpr doesn't work, what I do
wrong?

$url = 'http://website.com/path/file_name.img';
if (/\/.*$/)
{
    print $url."is matched \n";
}
else
{
    print "failed";
}

--
perl -e 'print unpack(u,"62V5N\"FME;G\!E<FQ`9VUA:6PN8V]M\"[EMAIL PROTECTED]
")'

you probably want

if( $url =~ /\/(.*$)/ )

then characters after last / are found in $1



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to