fork download
  1. #include<regex>
  2. #include<iostream>
  3.  
  4. using namespace std;
  5.  
  6. std::string getOsName()
  7. {
  8. #ifdef _WIN32
  9. return "Windows 32-bit";
  10. #elif _WIN64
  11. return "Windows 64-bit";
  12. #elif __unix || __unix__
  13. return "Unix";
  14. #elif __APPLE__ || __MACH__
  15. return "Mac OSX";
  16. #elif __linux__
  17. return "Linux";
  18. #elif __FreeBSD__
  19. return "FreeBSD";
  20. #else
  21. return "Other";
  22. #endif
  23. }
  24.  
  25. int main()
  26. {
  27. cout<< getOsName() << endl;
  28. std::string argv_1 = "s/one/two/three/four/";
  29. bool rename_is_correct = (std::regex_match( argv_1, std::basic_regex<char>
  30. ( "s?([/|@#])(?:(?!\\1).)+\\1(?:(?!\\1).)*\\1(?:(?:gi?|ig)?(?:\\1-?[1-9]\\d?)?|i)?" ) ));
  31. if (rename_is_correct) {
  32. cout<< "found" << endl;
  33. } else {
  34. cout<< "not found" << endl;
  35. }
  36. return 0;
  37. }
Success #stdin #stdout 0s 16160KB
stdin
Standard input is empty
stdout
Unix
not found