[#boost-urls-grammar-token_rule]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::token_rule
:relfileprefix: ../../../
:mrdocs:


Match a non‐empty string of characters from a set

== Synopsis


Declared in `<https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/token_rule.hpp#L78[boost/url/grammar/token_rule.hpp]>`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template<xref:boost/urls/grammar/CharSet.adoc[CharSet] CS>
constexpr
/* implementation-defined */::xref:boost/urls/grammar/implementation_defined/token_rule_t.adoc[token_rule_t]<CS>
token_rule(CS const& cs) noexcept;
----

== Description


If there is no more input, the error code    xref:boost/urls/grammar/error.adoc[error::need_more] is returned.


=== Value Type

[,cpp]
----
using value_type = core::string_view;
----

=== Example

Rules are used with the function xref:boost/urls/grammar/parse-0d.adoc[parse].

[,cpp]
----
system::result< core::string_view > rv = parse( "abcdef", token_rule( alpha_chars ) );
----

=== BNF

[,cpp]
----
token     = 1*( ch )
----


== Parameters


|===
| Name | Description

| *cs*
| The character set to use


|===

== See Also


xref:boost/urls/grammar/alpha_chars.adoc[alpha&lowbar;chars],        xref:boost/urls/grammar/parse-0d.adoc[parse]&period;






[.small]#Created with https://www.mrdocs.com[MrDocs]#