std::match_results<BidirIt,Alloc>::suffix
来自 cppreference.cn
< cpp | regex | match results
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
[编辑] 参见
返回目标序列开始和完全匹配开始之间的子序列 (公共成员函数) |