I've just updated parseUri. If you haven't seen the older version, parseUri is a function which splits any well-formed URI into its parts, all of which are optional. Its combination of accuracy, flexibility, and brevity is unrivaled. Edit (2024-04-05): See parseUri v2! Highlights: Comprehensively splits URIs, including splitting the query string into key/value pairs. (Enhanced) Two parsing modes: