parseUri

parseUri is a function which splits any well-formed URI into its parts, all of which are optional.

Website:http://blog.stevenlevithan.com/archives/parseuri