Espacios de nombres
Variantes
Acciones

std::regex_error

De cppreference.com
< cpp‎ | regex

 
 
Expresiones biblioteca Regular
Clases
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)
Algoritmos
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)
Los iteradores
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)
Excepciones
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)
Rasgos
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
Funciones miembro
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 : public std::runtime_error {

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

};
(desde C++11)
Define el tipo de objeto que sea arrojado como excepciones para informar de errores de la biblioteca de expresiones regulares .
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.

Contenido

[editar] Las funciones miembro

construye un objeto 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.

(miembro público función) [edit]
obtiene el std::regex_constants::error_type para 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.

(miembro público función) [edit]

Inherited from std::exception

Member functions

[virtual]
destructs el objeto de excepción
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.

(Virtual Member público of std::exception función) [edit]
[virtual]
devuelve una cadena explicativa
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.

(Virtual Member público of std::exception función) [edit]

[editar] Ejemplo

#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