[#boost-urls-pct_encoded_rule] = xref:boost/urls/pct_encoded_rule.adoc[boost::urls::pct_encoded_rule] :relfileprefix: ../../ :mrdocs: Rule for a string with percent‐encoded escapes == Synopsis Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/rfc/pct_encoded_rule.hpp#L84[boost/url/rfc/pct_encoded_rule.hpp]>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- template<xref:boost/urls/grammar/CharSet.adoc[grammar::CharSet] CS> constexpr /* implementation-defined */ pct_encoded_rule(CS const& cs) noexcept; ---- == Description This function returns a rule which matches a percent‐encoded string, permitting characters in the string which are also in the specified character set to be used unescaped. == Value Type [,cpp] ---- using value_type = pct_string_view; ---- == Example Rules are used with the function xref:boost/urls/grammar/parse-09.adoc[`grammar::parse`]. [,cpp] ---- // pchar = unreserved / pct-encoded / sub-delims / ":" / "@" system::result< pct_string_view > rv = grammar::parse( "Program%20Files", pct_encoded_rule( pchars ) ); ---- == BNF [,cpp] ---- pct-encoded = "%" HEXDIG HEXDIG ---- == Specification * https://datatracker.ietf.org/doc/html/rfc3986#section-2.1[] == Return Value A rule object. == Parameters [cols=2] |=== | Name | Description | *cs* | The character set indicating which characters are allowed without escapes. Any character which is not in this set must be escaped, or else parsing returns an error. |=== == See Also xref:boost/urls/grammar/parse-09.adoc[`grammar::parse`], xref:boost/urls/pchars.adoc[`pchars`], xref:boost/urls/pct_string_view.adoc[`pct_string_view`]. [.small]#Created with https://www.mrdocs.com[MrDocs]#