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).