---
name: "std::regex_iterator"
section: "3cxx"
platform: "linux"
package: "libstdc++-12-doc"
version: "12.4.0-5"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/std::regex_iterator/3cxx"
---

# std::regex\_iterator(3cxx)

## NAME

std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>

## SYNOPSIS

`#include <regex>`

### Public Types

**typedef** std::ptrdiff\_t **difference\_type**\
 **typedef** **std::forward\_iterator\_tag** **iterator\_category**\
 **typedef** const value\_type \* **pointer**\
 **typedef** const value\_type & **reference**\
 **typedef** **basic\_regex**\< **\_Ch\_type**, **\_Rx\_traits** \> **regex\_type**\
 **typedef** **match\_results**\< \_Bi\_iter \> **value\_type**\

### Public Member Functions

**regex\_iterator** ()=**default**\
 Provides a singular iterator, useful for indicating one-past-the-end of a range.  **regex\_iterator** (\_Bi\_iter \_\_a, \_Bi\_iter \_\_b, const **regex\_type** &**\_\_re**, **regex\_constants::match\_flag\_type** **\_\_m**=**regex\_constants::match\_default**)\
 **regex\_iterator** (\_Bi\_iter, \_Bi\_iter, const **regex\_type** &&, **regex\_constants::match\_flag\_type**=**regex\_constants::match\_default**)=**delete**\
 **regex\_iterator** (const **regex\_iterator** &)=**default**\
 Copy constructs a regex\_iterator.  const value\_type & **operator\*** () const noexcept\
 Dereferences a regex\_iterator.  **regex\_iterator** & **operator++** ()\
 Increments a regex\_iterator.  **regex\_iterator** **operator++** (int)\
 Postincrements a regex\_iterator.  const value\_type \* **operator-\>** () const noexcept\
 Selects a regex\_iterator member.  **regex\_iterator** & **operator=** (const **regex\_iterator** &)=**default**\
 Copy assigns one regex\_iterator to another.  bool **operator==** (const **regex\_iterator** &) const noexcept\
 Tests the equivalence of two regex iterators.  bool **operator==** (**default\_sentinel\_t**) const noexcept\

## Detailed Description

### template\<typename \_Bi\_iter, typename \_Ch\_type = typename iterator\_traits\<\_Bi\_iter\>::value\_type, typename \_Rx\_traits = regex\_traits\<\_Ch\_type\>\>

class std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>"An iterator adaptor that will provide repeated calls of regex\_search over a range until no more matches remain.

**Since**

C++11

## Constructor & Destructor Documentation

### template\<typename \_Bi\_iter , typename \_Ch\_type = typename iterator\_traits\<\_Bi\_iter\>::value\_type, typename \_Rx\_traits = regex\_traits\<\_Ch\_type\>\> std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::regex\_iterator ()` [default]`

Provides a singular iterator, useful for indicating one-past-the-end of a range.

Referenced by **std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::regex\_iterator()**.

### template\<typename \_Bi\_iter , typename \_Ch\_type = typename iterator\_traits\<\_Bi\_iter\>::value\_type, typename \_Rx\_traits = regex\_traits\<\_Ch\_type\>\> std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::regex\_iterator (\_Bi\_iter \_\_a, \_Bi\_iter \_\_b, const regex\_type & \_\_re, regex\_constants::match\_flag\_type \_\_m = regex\_constants::match\_default)` [inline]`

Constructs a regex\_iterator...

**Parameters**

*\_\_a* \[IN\] The start of a text range to search. \
 *\_\_b* \[IN\] One-past-the-end of the text range to search. \
 *\_\_re* \[IN\] The regular expression to match. \
 *\_\_m* \[IN\] Policy flags for match rules.

References **std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::regex\_iterator()**, and **std::regex\_search()**.

### template\<typename \_Bi\_iter , typename \_Ch\_type = typename iterator\_traits\<\_Bi\_iter\>::value\_type, typename \_Rx\_traits = regex\_traits\<\_Ch\_type\>\> std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::regex\_iterator (const regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \> &)` [default]`

Copy constructs a regex\_iterator.

## Member Function Documentation

### template\<typename \_Bi\_iter , typename \_Ch\_type = typename iterator\_traits\<\_Bi\_iter\>::value\_type, typename \_Rx\_traits = regex\_traits\<\_Ch\_type\>\> const value\_type & std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::operator\* () const` [inline]`, ` [noexcept]`

Dereferences a regex\_iterator.

### template\<typename \_Bi\_iter , typename \_Ch\_type = typename iterator\_traits\<\_Bi\_iter\>::value\_type, typename \_Rx\_traits = regex\_traits\<\_Ch\_type\>\> regex\_iterator & std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::operator++ ()

Increments a regex\_iterator.

### template\<typename \_Bi\_iter , typename \_Ch\_type = typename iterator\_traits\<\_Bi\_iter\>::value\_type, typename \_Rx\_traits = regex\_traits\<\_Ch\_type\>\> regex\_iterator std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::operator++ (int)` [inline]`

Postincrements a regex\_iterator.

### template\<typename \_Bi\_iter , typename \_Ch\_type = typename iterator\_traits\<\_Bi\_iter\>::value\_type, typename \_Rx\_traits = regex\_traits\<\_Ch\_type\>\> const value\_type \* std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::operator-\> () const` [inline]`, ` [noexcept]`

Selects a regex\_iterator member.

### template\<typename \_Bi\_iter , typename \_Ch\_type = typename iterator\_traits\<\_Bi\_iter\>::value\_type, typename \_Rx\_traits = regex\_traits\<\_Ch\_type\>\> regex\_iterator & std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::operator= (const regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \> &)` [default]`

Copy assigns one regex\_iterator to another.

### template\<typename \_Bi\_iter , typename \_Ch\_type = typename iterator\_traits\<\_Bi\_iter\>::value\_type, typename \_Rx\_traits = regex\_traits\<\_Ch\_type\>\> bool std::regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \>::operator== (const regex\_iterator\< \_Bi\_iter, \_Ch\_type, \_Rx\_traits \> &) const` [noexcept]`

Tests the equivalence of two regex iterators.

## Author

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