kennen:lib:regex_match
no way to compare when less than two revisions
Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
— | kennen:lib:regex_match [2019-11-20 16:10] (aktuell) – angelegt - Externe Bearbeitung 127.0.0.1 | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
+ | ====== regex_match() ====== | ||
+ | ''# | ||
+ | |||
+ | <code cpp> | ||
+ | bool regex_match(const string& s, const regex& e, match_flag_type flags = match_default) | ||
+ | bool regex_match(const string& s, smatch& m, const regex& e, match_flag_type flags = match_default) | ||
+ | bool regex_match(Bi first, Bi last, const regex& e, match_flag_type flags = match_default) | ||
+ | bool regex_match(Bi first, Bi last, smatch& m, const regex& e, match_flag_type flags = match_default) | ||
+ | </ | ||
+ | | ||
+ | | ||
+ | |||
+ | Die Funktionen sind als Schablonen definiert. Neben den hier angegebenen existieren Varianten für '' | ||
+ | |||
+ | ==== Parameter ==== | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | |||
+ | Optionen der Durchmusterung sind in [[..: | ||
+ | |||
+ | |||
+ | ==== Ergebnis ==== | ||
+ | Rückgabewert: | ||
+ | |||
+ | ==== Siehe auch ==== | ||
+ | [[regex_replace]], | ||
+ | [[regex_search]]. | ||
+ | |||
+ | ==== Beispiel ==== | ||
+ | <code cpp regex_match.cpp> | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | int main() | ||
+ | { | ||
+ | std::string expr = "", | ||
+ | std::smatch matches; | ||
+ | if (std:: | ||
+ | { | ||
+ | // matches[0] contains the original string. | ||
+ | // matches[n] contains a sub_match object for each matching subexpression | ||
+ | for (auto i = 0; i < matches.size(); | ||
+ | { | ||
+ | // sub_match is pair of iterators to the first | ||
+ | // and one past the last chars of the matching subexpression | ||
+ | // (matches[i].first, | ||
+ | std::string match = matches[i]; | ||
+ | std::cout << " | ||
+ | } | ||
+ | } | ||
+ | else std::cout << "The regexp \"" | ||
+ | << | ||
+ | } | ||
+ | </ | ||
kennen/lib/regex_match.txt · Zuletzt geändert: 2019-11-20 16:10 von 127.0.0.1