boost::urls::grammar::optional_rule
Match a rule, or the empty string
Synopsis
template<Rule R>
constexpr
/* implementation-defined */
optional_rule(R const& r);
Description
Optional BNF elements are denoted with square brackets. If the specified rule returns any error it is treated as if the rule did not match.
Example
Rules are used with the function grammar::parse
.
system::result< optional< core::string_view > > rv = parse( "", optional_rule( token_rule( alpha_chars ) ) );
See Also
alpha_chars
, parse
, optional
, token_rule
.
Created with MrDocs