fork download
  1. #include <string>
  2. #include <regex>
  3. #include <iostream>
  4.  
  5. int main()
  6. {
  7. std::string s;
  8. s += '\x06';
  9. s += '\x00';
  10. std::regex r(std::string(1, '\x06') + R"(\0)");
  11. std::smatch sm;
  12. if (std::regex_search(s, sm, r))
  13. {
  14. std::cout << "Success\n";
  15. return 0;
  16. }
  17.  
  18. std::cout << "Failure\n";
  19. }
Success #stdin #stdout 0.01s 5424KB
stdin
Standard input is empty
stdout
Success