在线文档教程
C++
规律表达 | Regular expressions

std::regex_constants::error_type

STD::regex[医]常数::错误[医]类型

Defined in header
typedef /*implementation defined*/ error_type;(since C++11)
constexpr error_type error_collate = /*unspecified*/; constexpr error_type error_ctype = /*unspecified*/; constexpr error_type error_escape = /*unspecified*/; constexpr error_type error_backref = /*unspecified*/; constexpr error_type error_brack = /*unspecified*/; constexpr error_type error_paren = /*unspecified*/; constexpr error_type error_brace = /*unspecified*/; constexpr error_type error_badbrace = /*unspecified*/; constexpr error_type error_range = /*unspecified*/; constexpr error_type error_space = /*unspecified*/; constexpr error_type error_badrepeat = /*unspecified*/; constexpr error_type error_complexity = /*unspecified*/; constexpr error_type error_stack = /*unspecified*/;(since C++11) (until C++17)
inline constexpr error_type error_collate = /*unspecified*/; inline constexpr error_type error_ctype = /*unspecified*/; inline constexpr error_type error_escape = /*unspecified*/; inline constexpr error_type error_backref = /*unspecified*/; inline constexpr error_type error_brack = /*unspecified*/; inline constexpr error_type error_paren = /*unspecified*/; inline constexpr error_type error_brace = /*unspecified*/; inline constexpr error_type error_badbrace = /*unspecified*/; inline constexpr error_type error_range = /*unspecified*/; inline constexpr error_type error_space = /*unspecified*/; inline constexpr error_type error_badrepeat = /*unspecified*/; inline constexpr error_type error_complexity = /*unspecified*/; inline constexpr error_type error_stack = /*unspecified*/;(since C++17)

error_type描述正则表达式解析过程中可能发生的错误的类型。

常数

ConstantExplanation
error_collatethe expression contains an invalid collating element name
error_ctypethe expression contains an invalid character class name
error_escapethe expression contains an invalid escaped character or a trailing escape
error_backrefthe expression contains an invalid back reference
error_brackthe expression contains mismatched square brackets ('' and '')
error_parenthe expression contains mismatched parentheses ('(' and ')')
error_bracethe expression contains mismatched curly braces ('{' and '}')
error_badbracethe expression contains an invalid range in a {} expression
error_rangethe expression contains an invalid character range (e.g. b-a)
error_spacethere was not enough memory to convert the expression into a finite state machine
error_badrepeatone of *?+{ was not preceded by a valid regular expression
error_complexitythe complexity of an attempted match exceeded a predefined level
error_stackthere was not enough memory to perform a match

注记

在C++11中,这些常量是用冗余关键字指定的。static,它被C++14通过lwg第2053期...

另见

regex_error (C++11)reports errors generated by the regular expressions library (class)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/regex/Error[医]类型