std::match_results::operator[]
Aus 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> const_reference operator[]( size_type n ) const; |
(seit C++11) | |
Gibt eine angegebene Sub-match .
Original:
Returns an 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.
Wenn
n == 0 wird gesamte abgestimmt Ausdruck zurückgegeben .Original:
If
n == 0, 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.
Wenn
n > 0 && n < size(), n th sub-match zurückgegeben .Original:
If
n > 0 && n < size(), 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.
wenn
n >= size() wird ein Sub-Spiel, das die unübertroffene Übereinstimmung zurückgegeben .Original:
if
n >= size(), a sub-match 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.
Parameter
| n | - | ganze Zahl angeben, welche passen, um zurückzukehren
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. |
Rückgabewert
Gibt ein Sub-Match, das die angegebene Spiel oder sub Spiel .
Original:
Returns a sub-match 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.
Beispiel
#include <iostream>
#include <regex>
#include <string>
int main()
{
std::regex re("a(a)*b");
std::string target("baaaby");
std::smatch sm;
std::regex_search(target, sm, re);
std::cout << sm[1] << '\n';
}
Output:
aa
Siehe auch
kehrt die Reihenfolge der Zeichen für die jeweilige Sub-Match Original: returns the sequence of characters for the particular sub-match The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (öffentliche Elementfunktion) | |