Namespaces
Variants

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

From cppreference.net
Regular expressions library
Classes
(C++11)
Algorithms
Iterators
Exceptions
Traits
Constants
(C++11)
Regex Grammar
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

関連項目

ターゲットシーケンスの先頭と完全一致の先頭の間の部分シーケンスを返す
(公開メンバ関数)