Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: very quick link regex

by GrandFather (Saint)
on Aug 03, 2007 at 04:55 UTC ( [id://630449]=note: print w/replies, xml ) Need Help??


in reply to very quick link regex

Are you trying to match, validate or extract parts?

my $url = 'http://www.page.com/files4/i/90c/1493010807t1.jpg'; my ($domain, $path, $file) = $url =~ m'^(\w+://[\w.]+/)(.*?/)([\w.]+)$ +'; print "$domain\n$path\n$file\n";

Prints:

http://www.page.com/ files4/i/90c/ 1493010807t1.jpg

which may or may not be anything like what you need to do.


DWIM is Perl's answer to Gödel

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (4)
As of 2025-01-16 14:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (54 votes). Check out past polls.