var uri = URI("http://john@doe.com:pass@example.org:8080/some/path/foo.html?hello=world#target/here") uri.host() => "doe.com:pass@example.org:8080" should be "example.org" See: http://jsfiddle.net/3SvmV/1/