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
[编辑] 参阅
返回目标序列的开头与完整匹配的开头之间的子序列 (public member function) |