std::regex_error
Da cppreference.com.
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
Elemento definito nell'header <regex>
|
||
class regex_error : public std::runtime_error { public: |
(dal C++11) | |
Definisce il tipo di oggetto lanciato come eccezioni per segnalare errori dalla libreria espressioni regolari.
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.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica] Membri funzioni
costruisce un oggetto 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. (metodo pubblico) | |
ottiene il std::regex_constants::error_type per 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. (metodo pubblico) |
Inherited from std::exception
Member functions
[virtuale] |
distrugge l'oggetto eccezione 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. (metodo pubblico virtuale) |
[virtuale] |
restituisce una stringa esplicativa 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. (metodo pubblico virtuale) |
[modifica] Esempio
#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