:relfileprefix: ../../ [#7FEF64479D7B54648CE593E84BB83F4456F483FD] = Function parse_uri pass:v,q[Return a reference to a parsed URL string] == Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- result parse_uri(string_view s); ---- == Description pass:v,q[This function parses a string according] pass:v,q[to the grammar below and returns a view] pass:v,q[referencing the passed string upon success,] pass:v,q[else returns an error.] pass:v,q[Ownership of the string is not transferred;] pass:v,q[the caller is responsible for ensuring that] pass:v,q[the lifetime of the character buffer extends] pass:v,q[until the view is no longer being accessed.] === Example [,cpp] ---- system::result< url_view > = parse_uri( "https://www.example.com/index.htm?id=guest#s1" ); ---- === BNF [,cpp] ---- URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-3[3. Syntax Components (rfc3986)] == Return Value * `result` == Parameters |=== | Name | Type | *s* | `string_view` |===