std::regex_iterator<BidirIt,CharT,Traits>:: operator*,operator->
From es.cppreference.net
<
cpp
|
regex
|
regex iterator
|
const
value_type
&
operator
*
(
)
const
;
|
(1) | (desde C++11) |
|
const
value_type
*
operator
-
>
(
)
const
;
|
(2) | (desde C++11) |
Extrae el actual
std::match_results
de un
regex_iterator
.
Valor de retorno
1)
Devuelve una referencia al actual
std::match_results
.
2)
Devuelve un puntero al actual
std::match_results
.
Ejemplo
Ejecutar este código
#include <iostream> #include <regex> #include <string> int main() { std::string hay{"1.1a2b3cjk34"}; std::regex needle("[1234]"); using Ri = std::regex_iterator<std::string::iterator>; for (Ri it{hay.begin(), hay.end(), needle}, last{}; it != last; ++it) std::cout << it->str(); std::cout << '\n'; }
Salida:
112334