Namespaces
Variants

std::regex_iterator<BidirIt,CharT,Traits>:: operator*,operator->

From cppreference.net
Regular expressions library
Classes
(C++11)
Algorithms
Iterators
Exceptions
Traits
Constants
(C++11)
Regex Grammar
const value_type & operator * ( ) const ;
(1) (C++11 이후)
const value_type * operator - > ( ) const ;
(2) (C++11 이후)

현재 std::match_results regex_iterator 에서 추출합니다.

반환값

1) 현재 std::match_results 에 대한 참조를 반환합니다.
2) 현재 std::match_results 에 대한 포인터를 반환합니다.

예제

#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';
}

출력:

112334