std::regex_traits::lookup_classname

来自cppreference.com
< cpp‎ | regex‎ | regex traits

template< class ForwardIt >

char_class_type lookup_classname( ForwardIt first,
                                  ForwardIt last,

                                  bool icase = false ) const;
如果字符序列[first, last)代表在目前充满的区域设置(一个有效的字符类之间的字符串[::]POSIX正则表达式),返回实现定义的值表示此字符类的名称。否则,返回为零
原文:
If the character sequence [first, last) represents the name of a valid character class in the currently imbued locale (that is, the string between [: and :] in POSIX regular expressions), returns the implementation-defined value representing this character class. Otherwise, returns zero.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
如果该参数icasetrue,字符类忽略字符的大小写,例如: [:lower:]表示的字符串的正则表达式std::regex_constants::icaseregex_traits<>::lookup_classname()产生呼叫[first, last)"lower"icase == true。此调用返回相同的位掩码的呼叫所产生的正则表达式[:alpha:]icase == false.
原文:
If the parameter icase is true, the character class ignores character case, e.g. the regex [:lower:] with std::regex_constants::icase generates a call to regex_traits<>::lookup_classname() with [first, last) indicating the string "lower" and icase == true. This call returns the same bitmask as the call generated by the regex [:alpha:] with icase == false.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
下面的字符类始终认为,在窄体和宽字符形式,返回的分类(icase == false)对应的std::ctype方面的一脉相承的语言环境得到匹配的分类,如下:
原文:
The following character classes are always recognized, in both narrow and wide character forms, and the classifications returned (with icase == false) correspond to the matching classifications obtained by the std::ctype facet of the imbued locale, as follows:
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
字符类
原文:
character class
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
std::ctype classification
"alnum" std::ctype_base::alnum
"alpha" std::ctype_base::alpha
"blank" std::ctype_base::blank
"cntrl" std::ctype_base::cntrl
"digit" std::ctype_base::digit
"graph" std::ctype_base::graph
"lower" std::ctype_base::lower
"print" std::ctype_base::print
"punct" std::ctype_base::punct
"space" std::ctype_base::space
"upper" std::ctype_base::upper
"xdigit" std::ctype_base::xdigit
"d" std::ctype_base::digit
"s" std::ctype_base::space
"w"
std::ctype_base::alnum选择性地添加'_'
原文:
std::ctype_base::alnum with '_' optionally added
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
字符串"w"返回的分类可以是完全一样,在这种情况下,"alnum"添加isctype()'_'明确.
原文:
The classification returned for the string "w" may be exactly the same as "alnum", in which case isctype() adds '_' explicitly.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

目录

[编辑] 参数

first, last -
一对迭代器确定的字符序列,表示一个字符类的名称
原文:
a pair of iterators which determines the sequence of characters that represents a name of a character class
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
icase -
如果为true,将忽略大写/小写区别的字符分类
原文:
if true, ignores the upper/lower case distinction in the character classification
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。
类型要求
-
ForwardIt 必须满足 ForwardIterator 的要求。

[编辑] 返回值

位掩码,表示字符分类确定给定的字符类,或者是零,如果类是未知的.
原文:
The bitmask representing the character classification determined by the given character class, or zero if the class is unknown.
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

[编辑] 示例

[编辑] 另请参阅

表示字符类中的成员资格
原文:
indicates membership in a character class
文本通过谷歌翻译机器翻译。
你可以帮忙校正和验证翻译。点击此处查看指示。

(公开成员函数)