Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext

grammar::dec_octet_rule

Match a decimal octet.

Synopsis

Defined in header <boost/url/grammar/dec_octet_rule.hpp>

constexpr implementation-defined dec_octet_rule;
Description

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

Value Type
using value_type = unsigned char;
Example

Rules are used with the function parse.

result< unsigned char > rv = parse( "255", dec_octet_rule );
BNF
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
See Also

parse.

Convenience header <boost/url/grammar.hpp>


PrevUpHomeNext