命名空间
变体
操作

std::match_results<BidirIt,Alloc>::suffix

来自 cppreference.cn
< cpp‎ | regex‎ | match results
 
 
 
正则表达式库
(C++11)
算法
迭代器
异常
特性
常量
(C++11)
正则表达式语法
 
 
const_reference suffix() const;
(自 C++11 起)

获取一个对 std::sub_match 对象的引用,该对象表示目标序列中正则表达式完全匹配结束和目标序列结束之间的部分。

ready() 必须为 true。否则,行为是未定义的。

目录

[编辑] 参数

(无)

[编辑] 返回值

对未匹配后缀的引用。

[编辑] 示例

#include <iostream>
#include <regex>
#include <string>
 
int main()
{
    std::regex re("a(a)*by");
    std::string target("baaaby123");
    std::smatch sm;
 
    std::regex_search(target, sm, re);
    std::cout << sm.suffix() << '\n';
}

输出

123

[编辑] 参见

返回目标序列开始和完全匹配开始之间的子序列
(公共成员函数) [编辑]