std::regex_constants::error_type

定义于头文件 <regex>
typedef /*implementation defined*/ error_type;
(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*/;
(C++11 起)
(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*/;
(C++17 起)

error_type 是描述可能在正则表达式剖析期间发生的错误的类型。

常量

常量 解释
error_collate 表达式含有非法对照字符名
error_ctype 表达式含有非法字符类名
error_escape 表达式含有非法转义字符或尾随转义
error_backref 表达式含有非法回溯引用
error_brack 表达式含有不匹配的方括号对( '[' 与 ']' )
error_paren 表达式含有不匹配的括号对( '(' 与 ')' )
error_brace 表达式含有不匹配的花括号对( '{' 与 '}' )
error_badbrace 表达式在 {} 表达式中含有非法范围
error_range 表达式含有非法字符范围(例如 [b-a] )
error_space 没有将表达式转换成有限状态机的足够内存
error_badrepeat *?+{ 之一不后继一个合法正则表达式
error_complexity 尝试的匹配的复杂度超过了预定义的等级
error_stack 没有进行匹配的足够内存

注意

C++11 中,这些常量曾被指定带有冗余的关键词 static ,它为 C++14 通过 LWG 问题 2053 移除

参阅

(C++11)
报告正则表达式库生成的错误
(类)

版本历史

  • (当前 | 先前 2017年6月16日 (五) 08:38Fruderica讨论 | 贡献. . (3,257字节) (-336). . (撤销)
  • 当前 | 先前 2013年7月2日 (二) 09:30P12bot讨论 | 贡献 . . (3,593字节) (-240). . (Use {{lc}}. Update links. Various fixes.) (撤销)
  • 当前 | 先前 2012年11月2日 (五) 12:35P12bot讨论 | 贡献 . . (3,833字节) (+225). . (r2.7.3) (机器人添加:de, en, es, fr, it, ja, pt, ru) (撤销)
  • 当前 | 先前 2012年10月27日 (六) 09:06P12讨论 | 贡献 . . (3,608字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前 2012年10月26日 (五) 06:00TranslationBot讨论 | 贡献. . (3,608字节) (-96). . (Translated from the English version using Google Translate) (撤销)
  • 当前 | 先前 2012年10月25日 (四) 15:32P12讨论 | 贡献 . . (3,704字节) (0). . (1个修订: Translate from the English version) (撤销)
  • 当前 | 先前) 2012年10月25日 (四) 12:00TranslationBot讨论 | 贡献. . (3,704字节) (+3,704). . (Translated from the English version using Google Translate)