Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 scrutinizing the Monastery: (2)
As of 2025-11-14 04:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your view on AI coding assistants?





    Results (70 votes). Check out past polls.

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.