Segundamano interview question

Code an URL parser (domain, subdomain, directory, parameters, hash, etc) on your preferred language.