std::match_results::size
De 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> size_type size() const; |
(depuis C++11) | |
Retourne le nombre de sous-correspondances, à savoir
std::distance(begin(), end()) .Original:
Returns the number of submatches, i.e.
std::distance(begin(), end()).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.
Paramètres
(Aucun)
Original:
(none)
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.
Retourne la valeur
Le nombre de sous-correspondances
Original:
The number of submatches
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.
Exceptions
Complexité
Constante
Original:
Constant
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.
Voir aussi
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.size() << '\n';
}
Résultat :
2