---
name: "std::__detail::_Scanner"
section: "3"
platform: "linux"
package: "gcc"
version: "16.2.1+r23+gd564253eb6c8-1"
release: "Arch Linux 2026-11-01"
platforms: ["linux"]
url: "https://new.carta.tech/std::__detail::_Scanner"
---

# std::\_\_detail::\_Scanner(3)

Scans an input range for regex tokens.

## NAME

std::\_\_detail::\_Scanner\< \_CharT \> - Scans an input range for regex tokens.

## SYNOPSIS

\#include \<regex\>

### Public Types

typedef const **std::ctype**\< \_CharT \> **\_CtypeT**\
 typedef **regex\_constants::syntax\_option\_type** **\_FlagT**\
 typedef **std::basic\_string**\< \_CharT \> **\_StringT**\
 enum **\_TokenT** : unsigned { **\_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** }\
 Token types returned from the scanner.

### Public Member Functions

**\_Scanner** (const \_CharT \*\_\_begin, const \_CharT \*\_\_end, **\_FlagT** \_\_flags, **std::locale** \_\_loc)\
 void **\_M\_advance** ()\
 \_TokenT **\_M\_get\_token** () const noexcept\
 const \_StringT & **\_M\_get\_value** () const noexcept\

### Protected Types

enum **\_StateT** { **\_S\_state\_normal**, **\_S\_state\_in\_brace**, **\_S\_state\_in\_bracket** }\

### Protected Member Functions

const char \* **\_M\_find\_escape** (char \_\_c)\
 bool **\_M\_is\_awk** () const\
 bool **\_M\_is\_basic** () const\
 bool **\_M\_is\_ecma** () const\
 bool **\_M\_is\_extended** () const\
 bool **\_M\_is\_grep** () const\

### Protected Attributes

bool **\_M\_at\_bracket\_start**\
 const **std::pair**\< char, char \> **\_M\_awk\_escape\_tbl** \[11\]\
 const char \* **\_M\_basic\_spec\_char**\
 const **std::pair**\< char, char \> **\_M\_ecma\_escape\_tbl** \[8\]\
 const char \* **\_M\_ecma\_spec\_char**\
 const **std::pair**\< char, char \> \* **\_M\_escape\_tbl**\
 const char \* **\_M\_extended\_spec\_char**\
 **\_FlagT** **\_M\_flags**\
 const char \* **\_M\_spec\_char**\
 \_StateT **\_M\_state**\
 \_TokenT **\_M\_token**\
 const **std::pair**\< char, \_TokenT \> **\_M\_token\_tbl** \[9\]\

## Detailed Description

### template\<typename \_CharT\>

class std::\_\_detail::\_Scanner\< \_CharT \>"Scans an input range for regex tokens.

The \_Scanner class interprets the regular expression pattern in the input range passed to its constructor as a sequence of parse tokens passed to the regular expression compiler. The sequence of tokens provided depends on the flag settings passed to the constructor: different regular expression grammars will interpret the same input pattern in syntactically different ways.

## Member Enumeration Documentation

### enum std::\_\_detail::\_ScannerBase::\_TokenT : unsigned \[inherited\]

Token types returned from the scanner.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
