Namensräume
Varianten
Aktionen

std::regex_traits::lookup_collatename

Aus cppreference.com
< cpp‎ | regex‎ | regex traits

 
 
Reguläre Ausdrücke Bibliothek
Classes
Original:
Classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
basic_regex(C++11)
sub_match(C++11)
match_results(C++11)
Algorithmen
Original:
Algorithms
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_match(C++11)
regex_search(C++11)
regex_replace(C++11)
Iteratoren
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_iterator(C++11)
regex_token_iterator(C++11)
Ausnahmen
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_error(C++11)
Traits
Original:
Traits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_traits(C++11)
Konstanten
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
syntax_option_type(C++11)
match_flag_type(C++11)
error_type(C++11)
 
std::regex_traits
Member-Funktionen
Original:
Member Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
regex_traits::regex_traits
regex_traits::length
regex_traits::translate
regex_traits::translate_nocase
regex_traits::transform
regex_traits::transform_primary
regex_traits::lookup_collatename
regex_traits::lookup_classname
regex_traits::isctype
regex_traits::value
regex_traits::imbue
regex_traits::getloc
 
template< class ForwardIt >
string_type lookup_collatename( ForwardIt first, ForwardIt last ) const;
Wenn die Zeichenfolge [first, last) steht für den Namen eines gültigen Sortierfolge Element in der Zeit durchdrungen locale gibt den Namen dieser Sortierfolge Element. Andernfalls gibt einen leeren String zurück .
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.
Zusammentragen Elemente sind die Symbole in POSIX regulären Ausdrücken zwischen [. und .] gefunden. Zum Beispiel passt [.a.] den Charakter a in der C locale. [.tilde.] entspricht dem Zeichen ~ in der Sprachumgebung C als gut. [.ch.] entspricht dem Digraphen ch in der Tschechischen locale, sondern erzeugt std::regex_error mit Fehlercode std::regex_constants::error_collate in den meisten anderen Orten .
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.

[Bearbeiten] Parameter

first, last -
ein Paar von Iteratoren, die die Folge von Zeichen, die eine Sortierfolge Elementname steht bestimmt
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.

[Bearbeiten] Rückgabewert

Die Darstellung des benannten Sortierfolge Element als Zeichenkette .
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.

[Bearbeiten] Beispiel

#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