std::match_results::prefix
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> const_reference prefix() const; |
(depuis C++11) | |
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
Retourne un sub_match représentant la partie de la séquence cible, entre le début de la séquence cible et l'intégralité du match de l'expression régulière .
Original:
Returns a sub_match representing the part of the target sequence between the beginning of the target sequence and the entire match of the regular expression.
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.
Exemple
#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.prefix().str() << '\n';
}
Résultat :
b