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

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,必须使用用户提供的特性类.

成员类型

TypeDefinition
char_typeCharT
string_typestd::basic_string<CharT>
locale_typeThe locale used for localized behavior in the regular expression. Must be CopyConstructible
char_class_typeRepresents 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 staticcalculates the length of a null-terminated character string (public static member function)
translatedetermines the equivalence key for a character (public member function)
translate_nocasedetermines the case-insensitive equivalence key for a character (public member function)
transformdetermines the sort key for the given string, used to provide collation order (public member function)
transform_primarydetermines the primary sort key for the character sequence, used to determine equivalence class (public member function)
lookup_collatenamegets a collation element by name (public member function)
lookup_classnamegets a character class by name (public member function)
isctypeindicates membership in a localized character class (public member function)
valuetranslates the character representing a numeric digit into an integral value (public member function)
imbuesets the locale (public member function)
getlocgets the locale (public member function)

© cppreference.com

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

http://en.cppreference.com/w/cpp/regex/regex[医]性状