Namensräume
Varianten

std::regex_error

Aus cppreference.com
< cpp‎ | regex

 
 
Reguläre Ausdrücke Bibliothek
Classes
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)
Algorithmen
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)
Iteratoren
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)
Ausnahmen
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)
Traits
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)
Konstanten
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
Member-Funktionen
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
 
definiert in Header <regex>
class regex_error :publicstd::runtime_error{

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

};
(seit C++11)
Definiert den Typ des Objekts als Ausnahmen geworfen, um Fehler aus dem regulären Ausdrücken Bibliothek berichten .
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.

Inhaltsverzeichnis

[Bearbeiten]Member-Funktionen

konstruiert eine regex_error Objekt
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.

(öffentliche Elementfunktion)[edit]
bekommt die für eine std::regex_constants::error_typeregex_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.

(öffentliche Elementfunktion)[edit]

Inherited from std::exception

Member functions

[virtuell]
Zerstört das Ausnahme-Objekt
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.

(virtuellen öffentlichen Member-Funktion of std::exception)[edit]
[virtuell]
gibt einen erläuternden String
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.

(virtuellen öffentlichen Member-Funktion of std::exception)[edit]

[Bearbeiten]Beispiel

#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";}}

Output:

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