Espaços nominais
Variantes
Ações

std::match_results::position

De cppreference.com

<metanoindex/>

 
 
Biblioteca de expressões regulares
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.
(C++11)
Algoritmos
Original:
Algorithms
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Iteradores
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Exceções
Original:
Exceptions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Características
Original:
Traits
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Constantes
Original:
Constants
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
(C++11)
 
std::match_results
Funções de membro
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.
match_results::match_results
match_results::~match_results
match_results::operator=
match_results::get_allocator
Estado
Original:
State
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
match_results::ready
acesso. Elemento
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
match_results::size
match_results::max_size
match_results::empty
match_results::length
match_results::position
match_results::str
match_results::operator_at
match_results::prefix
match_results::suffix
Iteradores
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
match_results::begin
match_results::cbegin
match_results::end
match_results::cend
Formato
Original:
Format
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
match_results::format
Modificadores
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
match_results::swap
 
<tbody> </tbody>
difference_type position( size_type sub = 0 ) const;
(desde C++11)
Retorna a posição do primeiro caractere da partida sub-especificado.
Original:
Returns the position of the first character of the 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.
Se n == 0, a posição do primeiro caractere de expressão combinado inteira é retornada.
Original:
If n == 0, the position of the first character of 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.
Se n > 0 && n < size(), a posição do primeiro caractere de n ª partida sub-é devolvido.
Original:
If n > 0 && n < size(), the position of the first character of 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.
se n >= size(), uma posição do primeiro caractere do jogo incomparável é devolvido.
Original:
if n >= size(), a position of the first character of 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.

Parâmetros

n -
número inteiro especificando que corresponde a examinar
Original:
integral number specifying which match to examine
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Valor de retorno

A posição do primeiro caractere da partida especificado ou match-sub.
Original:
The position of the first character of 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.

Exemplo

#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.position(1) << '\n';
}

Saída:

1

Veja também

retornos especificados sub-jogo
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.

(função pública membro) [edit]