:relfileprefix: ../../ [#EDDD9BD715415893E02FFF8F58576805A649BCC0] = Function parse_uri_reference pass:v,q[Return a reference to a parsed URL string] == Synopsis Declared in header `` [source,cpp,subs="verbatim,macros,-callouts"] ---- result parse_uri_reference(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_reference( "ws://echo.example.com/?name=boost#demo" ); ---- === BNF [,cpp] ---- URI-reference = URI / relative-ref URI = scheme ":" hier-part [ "?" query ] [ "#" fragment ] relative-ref = relative-part [ "?" query ] [ "#" fragment ] hier-part = "//" authority path-abempty / path-absolute / path-rootless / path-empty relative-part = "//" authority path-abempty / path-absolute / path-noscheme / path-abempty / path-empty ---- === Specification * link:https://datatracker.ietf.org/doc/html/rfc3986#section-4.1[4.1. URI Reference (rfc3986)] * link:https://www.rfc-editor.org/errata/eid5428[Errata ID: 5428 (rfc3986)] == Return Value * `result` == Parameters |=== | Name | Type | *s* | `string_view` |===