std::match_results::operator[]
Da 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. |
const_reference operator[]( size_type n ) const; |
(desde C++11) | |
Retorna uma partida sub-indicada.
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.
Se n == 0, expressão correspondente inteira é retornada.
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.
Se n > 0 && n < size(), n ª sub-jogo é devolvido.
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.
se n >= size(), um jogo de sub-representação do jogo incomparável é devolvido.
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.
Índice |
[editar] Parâmetros
n | - | número inteiro especificando que corresponde a retornar
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. |
[editar] Valor de retorno
Retorna uma partida sub-representando a partida especificado ou jogo sub.
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.
[editar] Exemplo
#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'; }
Saída:
aa
[editar] Veja também
retorna a seqüência de caracteres para o jogo sub-particular 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. (função pública membro) |