[re.badexp]

# 28 Text processing library [[text]](./#text)

## 28.6 Regular expressions library [[re]](re#badexp)

### 28.6.5 Class regex_error [re.badexp]

[ð](#lib:regex_error)

namespace std {class regex_error : public runtime_error {public:explicit regex_error(regex_constants::error_type ecode);
 regex_constants::error_type code() const; };}

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L9968)

The class regex_error defines the type of objects thrown as
exceptions to report errors from the regular expression library[.](#1.sentence-1)

[ð](#lib:regex_error,constructor)

`regex_error(regex_constants::error_type ecode);
`

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L9978)

*Postconditions*: ecode == code()[.](#2.sentence-1)

[ð](#lib:error_type)

`regex_constants::error_type code() const;
`

[3](#3)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/text.tex#L9990)

*Returns*: The error code that was passed to the constructor[.](#3.sentence-1)
