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

std::regex_constants::match_flag_type

STD::regex[医]常量::匹配[医]旗子[医]类型

Defined in header
typedef /*unspecified*/ match_flag_type;(since C++11)
constexpr match_flag_type match_default = 0; constexpr match_flag_type match_not_bol = /*unspecified*/; constexpr match_flag_type match_not_eol = /*unspecified*/; constexpr match_flag_type match_not_bow = /*unspecified*/; constexpr match_flag_type match_not_eow = /*unspecified*/; constexpr match_flag_type match_any = /*unspecified*/; constexpr match_flag_type match_not_null = /*unspecified*/; constexpr match_flag_type match_continuous = /*unspecified*/; constexpr match_flag_type match_prev_avail = /*unspecified*/; constexpr match_flag_type format_default = 0; constexpr match_flag_type format_sed = /*unspecified*/; constexpr match_flag_type format_no_copy = /*unspecified*/; constexpr match_flag_type format_first_only = /*unspecified*/;(since C++11) (until C++17)
inline constexpr match_flag_type match_default = 0; inline constexpr match_flag_type match_not_bol = /*unspecified*/; inline constexpr match_flag_type match_not_eol = /*unspecified*/; inline constexpr match_flag_type match_not_bow = /*unspecified*/; inline constexpr match_flag_type match_not_eow = /*unspecified*/; inline constexpr match_flag_type match_any = /*unspecified*/; inline constexpr match_flag_type match_not_null = /*unspecified*/; inline constexpr match_flag_type match_continuous = /*unspecified*/; inline constexpr match_flag_type match_prev_avail = /*unspecified*/; inline constexpr match_flag_type format_default = 0; inline constexpr match_flag_type format_sed = /*unspecified*/; inline constexpr match_flag_type format_no_copy = /*unspecified*/; inline constexpr match_flag_type format_first_only = /*unspecified*/;(since C++17)

match_flag_typeBitmaskType指定其他正则表达式匹配选项的。

常数

注:[first, last)指正在匹配的字符序列。

ConstantExplanation
match_not_bolThe first character in [first,last) will be treated as if it is not at the beginning of a line (i.e. ^ will not match [first,first)
match_not_eolThe last character in [first,last) will be treated as if it is not at the end of a line (i.e. $ will not match [last,last)
match_not_bow"\b" will not match [first,first)
match_not_eow"\b" will not match [last,last)
match_anyIf more than one match is possible, then any match is an acceptable result
match_not_nullDo not match empty sequences
match_continuousOnly match a sub-sequence that begins at first
match_prev_avail--first is a valid iterator position. When set, causes match_not_bol and match_not_bow to be ignored
format_defaultUse ECMAScript rules to construct strings in std::regex_replace (syntax documentation)
format_sedUse POSIX sed utility rules in std::regex_replace. (syntax documentation)
format_no_copyDo not copy un-matched strings to the output in std::regex_replace
format_first_onlyOnly replace the first match in std::regex_replace

所有常量,除match_defaultformat_default,是位掩码元素。大match_defaultformat_default常量是空位掩码。

注记

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

另见

regex_match (C++11)attempts to match a regular expression to an entire character sequence (function template)
syntax_option_type (C++11)general options controlling regex behavior (typedef)
error_type (C++11)describes different types of matching errors (typedef)

© cppreference.com

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

http://en.cppreference.com/w/cpp/regex/Match[医]旗子[医]类型