The Wayback Machine - https://web.archive.org/web/20170628172052/http://ja.cppreference.com/w/cpp/regex/regex_error
名前空間
変種
操作

std::regex_error

提供: cppreference.com
< cpp‎ | regex

 
 
正規表現ライブラリ
クラス
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_regex(C++11)
sub_match(C++11)
match_results(C++11)
アルゴリズム
Original:
Algorithms
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_match(C++11)
regex_search(C++11)
regex_replace(C++11)
イテレータ
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_iterator(C++11)
regex_token_iterator(C++11)
例外
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_error(C++11)
形質
Original:
Traits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_traits(C++11)
定数
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
syntax_option_type(C++11)
match_flag_type(C++11)
error_type(C++11)
 
std::regex_error
メンバー関数
Original:
Member Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_error::regex_error
regex_error::code
 
Defined in header <regex>
class regex_error :publicstd::runtime_error{

  public:
    explicit regex_error(regex_constants::error_type ecode);
    regex_constants::error_type code()const;

};
(C++11およびそれ以降)
正規表現ライブラリのエラーを報告するために、例外としてスローされたオブジェクトのタイプを定義します.
Original:
Defines the type of object thrown as exceptions to report errors from the regular expressions library.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

目次

[編集]メンバ関数

regex_errorオブジェクトを作成します
Original:
constructs a regex_error object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)[edit]
std::regex_constants::error_typeためregex_errorを取得します
Original:
gets the std::regex_constants::error_type for a regex_error
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(パブリックメンバ関数)[edit]

Inherited from std::exception

Member functions

例外オブジェクトを破棄します
Original:
destructs the exception object
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想パブリックメンバ関数of std::exception)[edit]
[仮想]
説明文字列を返します
Original:
returns an explanatory string
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(仮想パブリックメンバ関数of std::exception)[edit]

[編集]

#include <regex>#include <iostream>   int main(){try{std::regex re("[a-b][a");}catch(const std::regex_error& e){std::cout<<"regex_error caught: "<< e.what()<<'\n';if(e.code()==std::regex_constants::error_brack)std::cout<<"The code was error_brack\n";}}

出力:

regex_error caught: The expression contained mismatched [ and ]. The code was error_brack
close