Auxiliary functions to parse and validate parts of URIs.