CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [KevinR] expression for pulling domains out of URLs: Edit Log



scrpnsanctuary
Novice

Jun 9, 2009, 10:52 AM


Views: 4305
Re: [KevinR] expression for pulling domains out of URLs

I looked up URI::Split and found how they do it:


Code
sub uri_split { 
return $_[0] =~ m,(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?,;
}


### Example:
($scheme, $auth, $path, $query, $frag) = uri_split($uri)


It's a bit more than I need, but wow. I can dissect most of it but I need to look at it longer to understand it all.
----------
The vastness of what we know is only surpassed by the vastness of what we don't.

(This post was edited by scrpnsanctuary on Jun 9, 2009, 10:54 AM)


Edit Log:
Post edited by scrpnsanctuary (Novice) on Jun 9, 2009, 10:54 AM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives