Espaces de noms
Variantes
Actions

std::regex_error

De cppreference.com
< cpp‎ | regex

 
 
Regular expressions bibliothèque
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)
Algorithmes
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)
Les itérateurs
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)
Exceptions
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)
Constantes
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
Fonctions membres
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
 
Déclaré dans l'en-tête <regex>
class regex_error :publicstd::runtime_error{

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

};
(depuis C++11)
Définit le type d'objet jetés comme des exceptions pour signaler les erreurs provenant de la bibliothèque d'expressions régulières .
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.

Sommaire

[modifier]Fonctions membres

construit un objet 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.

(fonction membre publique)[edit]
obtient la std::regex_constants::error_type pour un 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.

(fonction membre publique)[edit]

Inherited from std::exception

Member functions

[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
Détruit l'objet exception
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.

(function membre virtuelle publique de std::exception)[edit]
[
virtuel
Original:
virtual
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
]
retourne une chaîne explicative
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.

(function membre virtuelle publique de std::exception)[edit]

[modifier]Exemple

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

Résultat :

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