[#boost-urls-grammar-dec_octet_rule]
= xref:boost.adoc[boost]::xref:boost/urls.adoc[urls]::xref:boost/urls/grammar.adoc[grammar]::dec&lowbar;octet&lowbar;rule
:relfileprefix: ../../../
:mrdocs:

Match a decimal octet

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
constexpr &sol;&ast; implementation-defined &ast;&sol; dec&lowbar;octet&lowbar;rule = &lcub;&rcub;;
----

== Description

A decimal octet is precise way of saying a number from 0 to 255&period; These are commonly used in IPv4 addresses&period;

== Value Type

[,cpp]
----
using value_type = unsigned char;
----
== Example

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

[,cpp]
----
system::result< unsigned char > rv = parse( "255", dec_octet_rule );
----
== BNF

[,cpp]
----
dec-octet   = DIGIT                 ; 0-9
            / %x31-39 DIGIT         ; 10-99
            / "1" 2DIGIT            ; 100-199
            / "2" %x30-34 DIGIT     ; 200-249
            / "25" %x30-35          ; 250-255
----
== Specification

* https://datatracker.ietf.org/doc/html/rfc3986#section-3.2.2[3&period;2&period;2&period;  Host (rfc3986)]

== See Also

xref:boost/urls/grammar/parse-09.adoc[`parse`]&period;


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