std::regex_traits::lookup_collatename
De cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody> template< class ForwardIt > string_type lookup_collatename( ForwardIt first, ForwardIt last ) const; |
||
Si la séquence de caractères
[first, last) représente le nom d'un élément valable de classement dans la locale courante imprégnés, retourne le nom de cet élément d'assemblage. Sinon, retourne une chaîne vide .Original:
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.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Assemblage des éléments sont les symboles qui se trouvent dans les expressions régulières POSIX entre
[. et .]. Par exemple, [.a.] correspond à la a personnage dans l'environnement local C. [.tilde.] correspond à la ~ personnage dans l'environnement local C ainsi. [.ch.] correspond à la ch digraphe locale tchèque, mais génère std::regex_error avec le code d'erreur std::regex_constants::error_collate dans la plupart des autres endroits .Original:
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.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Paramètres
| first, last | - | une paire d'itérateurs qui détermine la séquence de caractères qui représente le nom d'un élément d'assemblage
Original: a pair of iterators which determines the sequence of characters that represents a collating element name The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
| Type requirements | ||
-ForwardIt must meet the requirements of ForwardIterator.
|
Retourne la valeur
La représentation de l'élément d'assemblage nommé comme une chaîne de caractères .
Original:
The representation of the named collating element as a character string.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Exemple
#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';
}
Résultat :
regex_traits<>::lookup_collatename("tilde") returns "~"
true