fork download
  1. #include <string>
  2. #include <iostream>
  3. #include <regex>
  4. using namespace std;
  5.  
  6. int main() {
  7. std::regex r(R"(\b(?!\d*(\d)\d*\1)\d+\b)");
  8. char *str = "1234567890 987 787";
  9.  
  10. for (cregex_iterator it(str, str + strlen(str), r); it != cregex_iterator{}; it++)
  11. {
  12. cout << (*it).str() << endl;
  13. }
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 4944KB
stdin
Standard input is empty
stdout
1234567890
987