STD::__DETAIL::_SCANNER(3)
π NAME π
std::__detail::_Scanner< _CharT > β bestie, this one scans an input range for regex tokens. That's the whole job. It eats your pattern and spits out tokens. Periodt.
So real quick, the manual page you're reading? It's std::__det...r< _CharT >(3), from the Library Functions Manual β yes the title got squished in the header like that, don't @ me, and the whole thing lives in libstdc++. Ok now let's actually go. π«Ά
β¨ SYNOPSIS β¨
#include <regex>
πΈ Public Types
typedef const std::ctype< _CharT > _CtypeTβ the ctype of our char type, const-ed up, iconic.typedef regex_constants::syntax_option_type _FlagTβ the flag type. All your grammar switches are this.typedef std::basic_string< _CharT > _StringTβ the string type. Justbasic_string, keeping it cute.enum _TokenT : unsigned { ... }β the token types returned from the scanner. Underlying type isunsigned, no cap. The full lineup, in order, exactly like this:
_S_token_anychar, _S_token_ord_char,
_S_token_oct_num, _S_token_hex_num, _S_token_backref,
_S_token_subexpr_begin, _S_token_subexpr_no_group_begin,
_S_token_subexpr_lookahead_begin, _S_token_subexpr_end,
_S_token_bracket_begin, _S_token_bracket_neg_begin,
_S_token_bracket_end, _S_token_interval_begin,
_S_token_interval_end, _S_token_quoted_class,
_S_token_char_class_name, _S_token_collsymbol,
_S_token_equiv_class_name, _S_token_opt, _S_token_or,
_S_token_closure0, _S_token_closure1, _S_token_line_begin,
_S_token_line_end, _S_token_word_bound, _S_token_comma,
_S_token_dup_count, _S_token_eof, _S_token_bracket_dash,
_S_token_unknown
π Public Member Functions
_Scanner (const _CharT *__begin, const _CharT *__end, _FlagT __flags, std::locale __loc)β constructor! Hand it the begin, the end, your flags, and a locale. That's the whole vibe.void _M_advance ()β moves things along. Go, girl._TokenT _M_get_token () const noexceptβ hands you the current token.noexcept, as it should be. πconst _StringT & _M_get_value () const noexceptβ hands you the current value by const ref. Alsonoexcept. Also slay.
π¦ Protected Types
enum _StateT { _S_state_normal, _S_state_in_brace, _S_state_in_bracket }β the three states the scanner can be in: normal, in a brace, in a bracket. Pick your fighter.
π Protected Member Functions
const char * _M_find_escape (char __c)β hunts down the escape for__c.bool _M_is_awk () constβ are we in awk mode, bestie?bool _M_is_basic () constβ basic? π§bool _M_is_ecma () constβ ECMA? πbool _M_is_extended () constβ extended? β¨bool _M_is_grep () constβ grep?? π
π Protected Attributes
bool _M_at_bracket_startβ are we at the start of a bracket or not, that's the question.const std::pair< char, char > _M_awk_escape_tbl [11]β the awk escape table, size 11, const, protected, mysterious.const char * _M_basic_spec_charβ basic special chars.const std::pair< char, char > _M_ecma_escape_tbl [8]β ECMA escape table, size 8.const char * _M_ecma_spec_charβ ECMA special chars.const std::pair< char, char > * _M_escape_tblβ pointer to whichever escape table we're riding with.const char * _M_extended_spec_charβ extended special chars._FlagT _M_flagsβ the flags. Stored. Remembered. Respected.const char * _M_spec_charβ the special chars pointer._StateT _M_stateβ current state, one of the_StateTgirlies._TokenT _M_tokenβ current token.const std::pair< char, _TokenT > _M_token_tbl [9]β the token table, size 9, mapping acharto a_TokenT.
π Detailed Description π
template<typename _CharT>
class std::__detail::_Scanner< _CharT >
"Scans an input range for regex tokens."
Ok so the _Scanner class takes the regular expression pattern sitting in the input range you handed to its constructor and interprets it as a sequence of parse tokens, which then get passed along to the regular expression compiler. The sequence of tokens it gives you depends on the flag settings you passed to the constructor: different regular expression grammars will interpret the same input pattern in syntactically different ways. Same input, different grammar, different tokens. It's giving shapeshifter energy, fr fr. π₯
π Member Enumeration Documentation π
enum std::__detail::_ScannerBase::_TokenT : unsigned [inherited]
Token types returned from the scanner. (Yes bestie, inherited β it comes from _ScannerBase, not from this class directly. Iykyk.)
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. Not a human, just a robot doing its little robot best. π€π
And that's the whole page!! This absolute icon of a manual page is libstdc++'s own, and it signs off on its footer as std::__det...r< _CharT >(3) β so shoutout to libstdc++ for the source, and to whatever date this page was born on (the footer keeps that part quiet, and we respect its privacy π). Mwah. π
β¨
π¦ where this page comes from
- arch rolling: gcc 16.2.1+r23+gd564253eb6c8-1 Β· GPL-3.0-or-later WITH GCC-exception-3.1 AND GFDL-1.3-or-later
- fedora 44: libstdc++-docs 16.0.1-0.10.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- fedora 44: libstdc++-docs 16.2.1-2.fc44
- fedora 44: libstdc++-docs 16.2.1-3.fc44 Β· GPL-3.0-or-later AND LGPL-3.0-or-later AND (GPL-3.0-or-later WITH GCC-exception-3.1) AND (GPL-3.0-or-later WITH Texinfo-exception) AND (LGPL-2.1-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GCC-exception-2.0) AND (GPL-2.0-or-later WITH GNU-compiler-exception) AND BSL-1.0 AND GFDL-1.3-or-later AND Linux-man-pages-copyleft-2-para AND SunPro AND BSD-1-Clause AND BSD-2-Clause AND BSD-2-Clause-Views AND BSD-3-Clause AND BSD-4-Clause AND BSD-Source-Code AND Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 WITH LLVM-Exception) AND ZPL-2.1 AND ISC AND LicenseRef-Fedora-Public-Domain AND HP-1986 AND curl AND Martin-Birgmeier AND HPND-Markus-Kuhn AND dtoa AND SMLNJ AND AMD-newlib AND OAR AND HPND-merchantability-variant AND HPND-Intel
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms