std::match_results::position
Da cppreference.com.
< cpp | regex | match results
Versione del 2 lug 2013 alle 14:59 di P12bot (Discussione | contributi)
![]() |
Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate.
La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
difference_type position( size_type sub = 0 ) const; |
(dal C++11) | |
Restituisce la posizione del primo carattere della specificato sub-partita.
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.
You can help to correct and verify the translation. Click here for instructions.
Se n == 0, la posizione del primo carattere intera espressione corrispondente viene restituito.
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.
You can help to correct and verify the translation. Click here for instructions.
Se n > 0 && n < size(), la posizione del primo carattere di n ° sub-partita viene restituito.
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.
You can help to correct and verify the translation. Click here for instructions.
se n >= size(), una posizione del primo carattere della partita senza pari viene restituito.
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.
You can help to correct and verify the translation. Click here for instructions.
Indice |
[modifica] Parametri
n | - | numero intero che specifica che corrispondono ad esaminare
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. |
[modifica] Valore di ritorno
La posizione del primo carattere della partita specificato o sub-partita.
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.
You can help to correct and verify the translation. Click here for instructions.
[modifica] Esempio
#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'; }
Output:
1
[modifica] Vedi anche
rendimenti indicati sub-partita 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. (metodo pubblico) |