---
name: "std::tr1::regex_error"
section: "3cxx"
platform: "linux"
package: "libstdc++6-4.4-doc"
version: "4.4.5-8"
release: "Debian 6.0 (Squeeze)"
platforms: ["linux"]
url: "https://new.carta.tech/std::tr1::regex_error"
---

# std::tr1::regex\_error(3cxx)

A regular expression exception class. The regular expression library throws objects of this class on error.

## NAME

std::tr1::regex\_error -

A regular expression exception class.

The regular expression library throws objects of this class on error.

## SYNOPSIS

Inherits **std::runtime\_error**.

### Public Member Functions

regex\_constants::error\_type **code** () const \
 **regex\_error** (regex\_constants::error\_type \_\_ecode)\
 virtual const char \* **what** () const   throw ()\

### Protected Attributes

regex\_constants::error\_type **\_M\_code**\

## Detailed Description

A regular expression exception class.

The regular expression library throws objects of this class on error.

Definition at line 393 of file tr1\_impl/regex.

## Constructor & Destructor Documentation

### std::tr1::regex\_error::regex\_error (regex\_constants::error\_type \_\_ecode)` [inline, explicit]`

Constructs a **regex\_error** object. **Parameters:**

*ecode* the regex error code.

Definition at line 403 of file tr1\_impl/regex.

## Member Function Documentation

### regex\_constants::error\_type std::tr1::regex\_error::code () const` [inline]`

Gets the regex error code. **Returns:**

the regex error code.

Definition at line 413 of file tr1\_impl/regex.

### virtual const char\* std::runtime\_error::what () const throw ()` [virtual, inherited]` Returns a C-style character string describing the general cause of the current error (the same string passed to the ctor).

Reimplemented from **std::exception**.

## Author

Generated automatically by Doxygen for libstdc++ from the source code.
