std::regex_traits<CharT>:: translate_nocase
| Localization library | |||||||||||||||||||||||||
| Regular expressions library (C++11) | |||||||||||||||||||||||||
| Formatting library (C++20) | |||||||||||||||||||||||||
| Null-terminated sequence utilities | |||||||||||||||||||||||||
| Byte strings | |||||||||||||||||||||||||
| Multibyte strings | |||||||||||||||||||||||||
| Wide strings | |||||||||||||||||||||||||
| Primitive numeric conversions | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
| Text encoding identifications | |||||||||||||||||||||||||
|
|||||||||||||||||||||||||
| Classes | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Algorithms | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Iterators | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Exceptions | ||||
|
(C++11)
|
||||
| Traits | ||||
|
(C++11)
|
||||
| Constants | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Regex Grammar | ||||
|
(C++11)
|
| Member functions | ||||
|
regex_traits::translate_nocase
|
||||
|
CharT translate_nocase
(
CharT c
)
const
;
|
||
获取字符 c 的比较键值,使得在注入的区域设置中所有与该字符等效(忽略大小写差异,若存在)的字符均生成相同的键值。
当正则表达式库需要匹配两个字符
c1
和
c2
且标志位
std::regex_constants::icase
为
true
时,它会执行
regex_traits
<>
::
translate_nocase
(
c1
)
==
regex_traits
<>
::
translate_nocase
(
c2
)
。
标准库对 std::regex_traits 的特化版本会返回 std:: use_facet < std:: ctype < CharT >> ( getloc ( ) ) . tolower ( c ) ,即使用当前植入的区域设置将 c 转换为小写形式。
参数
| c | - | 需要检查是否等效的字符(忽略大小写) |
返回值
当前所植入区域设置中 c 的不区分大小写比较键值。
示例
|
本节内容不完整
原因:缺少示例 |