std::regex_traits<CharT>::lookup_collatename (3) - Linux Manuals
std::regex_traits<CharT>::lookup_collatename: std::regex_traits<CharT>::lookup_collatename
Command to display std::regex_traits<CharT>::lookup_collatename
manual in Linux: $ man 3 std::regex_traits<CharT>::lookup_collatename
NAME
std::regex_traits<CharT>::lookup_collatename - std::regex_traits<CharT>::lookup_collatename
Synopsis
template< class ForwardIt >
string_type lookup_collatename( ForwardIt first, ForwardIt last ) const;
If the character sequence [first, last) represents the name of a valid collating element in the currently imbued locale, returns the name of that collating element. Otherwise, returns an empty string.
Collating elements are the symbols found in POSIX regular expressions between [. and .]. For example, [.a.] matches the character a in the C locale. [.tilde.] matches the character ~ in the C locale as well. [.ch.] matches the digraph ch in Czech locale, but generates std::regex_error with error code std::regex_constants::error_collate in most other locales.
Parameters
first, last - a pair of iterators which determines the sequence of characters that represents a collating element name
Type requirements
-
ForwardIt must meet the requirements of LegacyForwardIterator.
Return value
The representation of the named collating element as a character string.
Example
// Run this code
#include <iostream>
#include <string>
#include <regex>
struct noisy_traits : std::regex_traits<char> {
template< class Iter >
string_type lookup_collatename( Iter first, Iter last ) const {
string_type result = regex_traits::lookup_collatename(first, last);
std::cout << "regex_traits<>::lookup_collatename(\""
<< string_type(first, last)
<< "\") returns \"" << result << "\"\n";
return result;
}
};
int main()
{
std::string str = "z|}a"; // C locale collation order: x,y,z,{,|,},~
std::basic_regex<char, noisy_traits> re("[x-[.tilde.]]*a", std::regex::basic);
std::cout << std::boolalpha << std::regex_match(str, re) << '\n';
}
Output:
regex_traits<>::lookup_collatename("tilde") returns "~"
true
Pages related to std::regex_traits<CharT>::lookup_collatename
- std::regex_traits<CharT>::lookup_classname (3) - std::regex_traits<CharT>::lookup_classname
- std::regex_traits<CharT>::length (3) - std::regex_traits<CharT>::length
- std::regex_traits<CharT>::getloc (3) - std::regex_traits<CharT>::getloc
- std::regex_traits<CharT>::imbue (3) - std::regex_traits<CharT>::imbue
- std::regex_traits<CharT>::isctype (3) - std::regex_traits<CharT>::isctype
- std::regex_traits<CharT>::regex_traits (3) - std::regex_traits<CharT>::regex_traits
- std::regex_traits<CharT>::transform (3) - std::regex_traits<CharT>::transform
- std::regex_traits<CharT>::transform_primary (3) - std::regex_traits<CharT>::transform_primary
- std::regex_traits<CharT>::translate (3) - std::regex_traits<CharT>::translate
- std::regex_traits<CharT>::translate_nocase (3) - std::regex_traits<CharT>::translate_nocase
- std::regex_traits<CharT>::value (3) - std::regex_traits<CharT>::value
- std::regex_traits (3) - std::regex_traits
- std::regex_token_iterator (3) - std::regex_token_iterator
- std::regex_token_iterator<BidirIt,CharT,Traits>::operator*,operator-> (3) - std::regex_token_iterator<BidirIt,CharT,Traits>::operator*,operator->
- std::regex_token_iterator<BidirIt,CharT,Traits>::operator++,operator++(int) (3) - std::regex_token_iterator<BidirIt,CharT,Traits>::operator++,operator++(int)
- std::regex_token_iterator<BidirIt,CharT,Traits>::operator= (3) - std::regex_token_iterator<BidirIt,CharT,Traits>::operator=