Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: regex to match URLs

by atcroft (Abbot)
on Feb 28, 2006 at 20:33 UTC ( [id://533495]=note: print w/replies, xml ) Need Help??


in reply to regex to match URLs

You may wish to look at the URI module, if you are looking to get specific components. Also, the documentation for that module includes a regex that can be used to split a URI into its parts (something also handled by URI::Split's uri_split() function)-it is possible you might be able to adapt that regex to ensure what you want is there.

Hope that helps.

Replies are listed 'Best First'.
Re^2: regex to match URLs
by ikegami (Patriarch) on Feb 28, 2006 at 20:43 UTC

    URI will not do the trick, since it accepts both absolute and relative URIs, and it doesn't do validation.

    For example, "www.example.com" is accepted (even though it's not a valid absolute URI), ":80" and "http://:80" are accepted (even though they are not valid URIs).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-03-28 09:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found