std::match_results::str
De cppreference.com
< cpp | regex | match results
![]() |
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. |
string_type str( size_type n = 0 ) const; |
(depuis C++11) | |
Retourne une chaîne qui représente le sous-indiqué match .
Original:
Returns a string representing the indicated sub-match.
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.
Si n == 0, une chaîne qui représente toute expression correspondant est retourné .
Original:
If n == 0, a string representing entire matched expression is returned.
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.
Si n > 0 && n < size(), une chaîne représentant n e sous-match est retourné .
Original:
If n > 0 && n < size(), a string representing nth sub-match is returned.
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.
si n >= size(), une chaîne représentant le match inégalée est retourné .
Original:
if n >= size(), a string representing the unmatched match is returned.
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.
L'appel est équivalent à string_type((*this)[n]);
Original:
The call is equivalent to string_type((*this)[n]);
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.
Sommaire |
[modifier] Paramètres
n | - | nombre entier spécifiant ce qui correspond au retour
Original: integral number specifying which match to return The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifier] Retourne la valeur
Renvoie une chaîne représentant le match spécifiée ou un match sous .
Original:
Returns a string representing the specified match or sub match.
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.
[modifier] Exemple
#include <iostream> #include <regex> #include <string> int main() { std::regex re("a(a)*b"); std::string target("aaab"); std::smatch sm; std::regex_match(target, sm, re); std::cout << sm.str(1) << '\n'; }
Résultat :
aaa
[modifier] Voir aussi
rendement indiqués correspondent à des sous- Original: returns specified sub-match The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction membre publique) |