Namespaces
Variants
Actions

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

From cppreference.com
< cpp‎ | regex‎ | regex iterator
 
 
 
Regular expressions library
Classes
(C++11)
(C++11)
Algorithms
(C++11)
(C++11)
Iterators
Exceptions
(C++11)
Traits
(C++11)
Constants
(C++11)
Regex Grammar
 
 
const value_type& operator*() const;
(1) (since C++11)
const value_type* operator->() const;
(2) (since C++11)

Extracts the current std::match_results from a regex_iterator.

[edit] Return value

1) Returns a reference to the current std::match_results .
2) Returns a pointer to the current std::match_results .

[edit] Example

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

Output:

112334
Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/regex/regex_iterator/operator*&oldid=161421"

AltStyle によって変換されたページ (->オリジナル) /