I think this RegExp deserves a comment as well -- that the port should be stripped from the end of the authority if it matches the default port for the protocol.