NexusForce 1.0.0
A Modern C++ Library with extended functionality, web components, and utility libraries
载入中...
搜索中...
未找到
regex_iterator类 参考

正则表达式匹配迭代器 更多...

#include <regex.hpp>

Public 类型

using iterator_category = bidirectional_iterator_tag
 迭代器类型
using value_type = match_result
 元素类型
using difference_type = ptrdiff_t
 差值类型
using pointer = const match_result*
 指针类型
using reference = const match_result&
 引用类型

Public 成员函数

 regex_iterator ()=default
 默认构造函数,构造结束迭代器
 regex_iterator (const regex *re, string str, size_t pos=0)
 构造函数
NEFORCE_NODISCARD reference operator* () const
 解引用操作符
NEFORCE_NODISCARD pointer operator-> () const
 成员访问操作符
regex_iteratoroperator++ ()
 前置递增操作符
regex_iterator operator++ (int)
 后置递增操作符
regex_iteratoroperator-- ()
 前置递减操作符
regex_iterator operator-- (int)
 后置递减操作符
NEFORCE_NODISCARD bool operator== (const regex_iterator &other) const noexcept
 相等比较操作符
NEFORCE_NODISCARD bool operator!= (const regex_iterator &other) const noexcept
 不等比较操作符

静态 Public 成员函数

static regex_iterator from_index (const regex *re, const string &str, ptrdiff_t index)
 从指定索引构造迭代器
static regex_iterator begin (const regex *re, const string &str)
 获取起始迭代器
static regex_iterator end (const regex *re, const string &str)
 获取结束迭代器

详细描述

正则表达式匹配迭代器

双向迭代器,用于遍历字符串中的所有匹配结果。 支持向前和向后遍历。

在文件 regex.hpp338 行定义.

构造及析构函数说明

◆ regex_iterator()

regex_iterator::regex_iterator ( const regex * re,
string str,
size_t pos = 0 )

构造函数

参数
re正则表达式对象
str待遍历的字符串
pos起始位置

成员函数说明

◆ begin()

regex_iterator regex_iterator::begin ( const regex * re,
const string & str )
inlinestatic

获取起始迭代器

参数
re正则表达式对象
str待遍历的字符串
返回
起始迭代器

在文件 regex.hpp462 行定义.

引用了 regex_iterator().

◆ end()

regex_iterator regex_iterator::end ( const regex * re,
const string & str )
inlinestatic

获取结束迭代器

参数
re正则表达式对象
str待遍历的字符串
返回
结束迭代器

在文件 regex.hpp470 行定义.

引用了 regex_iterator().

◆ from_index()

regex_iterator regex_iterator::from_index ( const regex * re,
const string & str,
ptrdiff_t index )
static

从指定索引构造迭代器

参数
re正则表达式对象
str待遍历的字符串
index索引位置
返回
迭代器

引用了 regex_iterator().

◆ operator!=()

NEFORCE_NODISCARD bool regex_iterator::operator!= ( const regex_iterator & other) const
inlinenoexcept

不等比较操作符

参数
other另一个迭代器
返回
不等返回true

在文件 regex.hpp454 行定义.

引用了 regex_iterator().

◆ operator*()

NEFORCE_NODISCARD reference regex_iterator::operator* ( ) const

解引用操作符

返回
当前匹配结果

◆ operator++() [1/2]

regex_iterator & regex_iterator::operator++ ( )
inline

前置递增操作符

返回
递增后的迭代器

在文件 regex.hpp402 行定义.

引用了 regex_iterator().

◆ operator++() [2/2]

regex_iterator regex_iterator::operator++ ( int )
inline

后置递增操作符

返回
递增前的迭代器

在文件 regex.hpp411 行定义.

引用了 regex_iterator().

◆ operator--() [1/2]

regex_iterator & regex_iterator::operator-- ( )
inline

前置递减操作符

返回
递减后的迭代器

在文件 regex.hpp421 行定义.

引用了 regex_iterator().

◆ operator--() [2/2]

regex_iterator regex_iterator::operator-- ( int )
inline

后置递减操作符

返回
递减前的迭代器

在文件 regex.hpp436 行定义.

引用了 regex_iterator().

◆ operator->()

NEFORCE_NODISCARD pointer regex_iterator::operator-> ( ) const
inline

成员访问操作符

返回
当前匹配结果指针

在文件 regex.hpp396 行定义.

引用了 operator*().

◆ operator==()

NEFORCE_NODISCARD bool regex_iterator::operator== ( const regex_iterator & other) const
noexcept

相等比较操作符

参数
other另一个迭代器
返回
相等返回true

引用了 regex_iterator().


该类的文档由以下文件生成: