fork download
  1. #include <regex>
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main() {
  7.  
  8. cout<<std::regex_match("ab", std::regex("(a|ab)")) << std::endl;
  9. cout<<std::regex_match("ab", std::regex("(ab|a)")) << std::endl;
  10.  
  11. return 0;
  12. }
Success #stdin #stdout 0s 16160KB
stdin
Standard input is empty
stdout
1
1