Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: regex a url

by kelan (Deacon)
on Oct 06, 2002 at 15:08 UTC ( [id://203170]=note: print w/replies, xml ) Need Help??


in reply to regex a url

You can do this without a regex quite easily. How about this:
$uri = 'http://www.merchandisemarket.net/shop/s_images/aaa_small.gif'; $i = rindex($uri, '/') + 1; # Starting at the chara +cter one after the last slash, $filename = substr($uri, $i, length($uri)-$i); # get a substring with +the rest of the string

kelan


Yak it up with Fullscreen ChatterBox

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://203170]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-26 06:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found