std::regex_iterator<BidirIt,CharT,Traits>::operator*,operator-> - cppreference.com (original) (raw)
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
[edit] Example
#include #include #include int main() { std::string hay{"1.1a2b3cjk34"}; std::regex needle("[1234]"); using Ri = std::regex_iteratorstd:🧵:iterator; for (Ri it{hay.begin(), hay.end(), needle}, last{}; it != last; ++it) std::cout << it->str(); std::cout << '\n'; }
Output: