std::match_results<BidirIt,Alloc>::suffix
來自 cppreference.com
< 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) |