fork(1) download
  1. #include <iostream>
  2. #include <regex>
  3. #include <string>
  4.  
  5. int main()
  6. {
  7. std::string example{" <match1> <match2> <match3>"};
  8. std::regex re{"<([^>]+)>"};
  9. std::regex_token_iterator<std::string::iterator> it{example.begin(), example.end(), re, 1};
  10. decltype(it) end{};
  11. while (it != end) std::cout << *it++ << std::endl;
  12. return 0;
  13. }
Success #stdin #stdout 0s 3368KB
stdin
Standard input is empty
stdout
match1
match2
match3