fork(1) download
  1. #include <iostream>
  2. #include <regex>
  3.  
  4. using namespace std;
  5.  
  6. int main() {
  7. string text = "hi";
  8. regex rgx(text);
  9.  
  10. if(regex_match("history is a subject", rgx) == true)
  11. cout << "false"; // never gona print as rgx=hi
  12.  
  13. if(regex_match("hi", rgx) == true)
  14. cout << "Matched";
  15.  
  16. return 0;
  17. }
Success #stdin #stdout 0s 3508KB
stdin
Standard input is empty
stdout
Matched