fork download
  1. #include <iostream>
  2. #include <regex>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main() {
  7. regex e("1");
  8. string s = "1,";
  9. s.back() = '\0';
  10.  
  11. cout << regex_match("1", e) << endl;
  12. cout << regex_match(s, e) << endl;
  13.  
  14. return 0;
  15. }
Success #stdin #stdout 0s 3504KB
stdin
Standard input is empty
stdout
1
0