fork download
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <regex>
  4. #include <string>
  5.  
  6. using namespace std;
  7.  
  8. int main() {
  9. auto foo = "a+\\+"s;
  10. regex bar("((?:[^\\\\\\+]|\\\\.)+)");
  11. copy(sregex_token_iterator(cbegin(foo), cend(foo), bar, 1), sregex_token_iterator(), ostream_iterator<string>(cout, "\n"));
  12. }
Success #stdin #stdout 0s 3504KB
stdin
Standard input is empty
stdout
a
\+