std::regex_traits
STD::regex[医]性状
Defined in header | | |
---|---|---|
template< class CharT > class regex_traits; | | (since C++11) |
类型性状模板regex_traits
供应品std::basic_regex
具有对该类型进行操作所需的类型和函数集。CharT
...
因为许多regex操作都是对地区敏感的%28,所以std::regex_constants::collate
标志设置为%29,正则表达式[医]属性类通常包含std::locale
作为私人成员。
标准专业化
两个专门化std::regex_traits
由标准库定义:
STD::regex[医]性状<char>
*。
STD::regex[医]性状<wchar[医]T>
这些专门化使使用成为可能。std::basic_regex<char>百分之二十八std::regex29%和std::basic_regex<wchar_t>百分之二十八std::wregex29%。使用std::basic_regex例如,对于其他字符类型%28,char32_t%29,必须使用用户提供的特性类.
成员类型
Type | Definition |
---|---|
char_type | CharT |
string_type | std::basic_string<CharT> |
locale_type | The locale used for localized behavior in the regular expression. Must be CopyConstructible |
char_class_type | Represents a character classification and is capable of holding an implementation specific set returned by lookup_classname. Must be a BitmaskType. |
成员函数
(constructor) | constructs the regex_traits object (public member function) |
---|---|
length static | calculates the length of a null-terminated character string (public static member function) |
translate | determines the equivalence key for a character (public member function) |
translate_nocase | determines the case-insensitive equivalence key for a character (public member function) |
transform | determines the sort key for the given string, used to provide collation order (public member function) |
transform_primary | determines the primary sort key for the character sequence, used to determine equivalence class (public member function) |
lookup_collatename | gets a collation element by name (public member function) |
lookup_classname | gets a character class by name (public member function) |
isctype | indicates membership in a localized character class (public member function) |
value | translates the character representing a numeric digit into an integral value (public member function) |
imbue | sets the locale (public member function) |
getloc | gets the locale (public member function) |
© cppreference.com
在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。