名前空間
変種
操作

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

From cppreference.com
< cpp‎ | regex‎ | match results
 
 
 
正規表現ライブラリ
クラス
(C++11)
アルゴリズム
イテレータ
例外
Traits
定数
(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

[編集] 関連項目

ターゲットシーケンスの開始と全体のマッチの開始の間のサブシーケンスを返します。
(public member function) [編集]
English 日本語 中文(简体) 中文(繁體)