[#boost-urls-grammar-token_rule]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::token&lowbar;rule
:relfileprefix: ../../../
:mrdocs:


Match a non&hyphen;empty string of characters from a set

== Synopsis


Declared in `&lt;https://www.github.com/boostorg/url/blob/develop/include/boost/url/grammar/token_rule.hpp#L78[boost&sol;url&sol;grammar&sol;token&lowbar;rule&period;hpp]&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;xref:boost/urls/grammar/CharSet.adoc[CharSet] CS&gt;
constexpr
&sol;&ast; implementation-defined &ast;&sol;::xref:boost/urls/grammar/implementation_defined/token_rule_t.adoc[token&lowbar;rule&lowbar;t]&lt;CS&gt;
token&lowbar;rule(CS const& cs) noexcept;
----

== Description


If there is no more input, the error code    xref:boost/urls/grammar/error.adoc[error&colon;&colon;need&lowbar;more] is returned&period;


=== Value Type

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

=== Example

Rules are used with the function xref:boost/urls/grammar/parse-02.adoc[parse]&period;

[,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-02.adoc[parse]&period;






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