fork(1) download
  1. #include <iostream>
  2. #include <regex>
  3. using namespace std;
  4.  
  5. int main() {
  6. string str;
  7. getline(cin, str);
  8.  
  9. regex e("a+\\s+b+");
  10.  
  11. if (regex_match(str,e))
  12. cout<<"Matched";
  13. else
  14. cout<<"No Match";
  15. return 0;
  16. }
  17.  
Success #stdin #stdout 0s 5280KB
stdin
a b
stdout
Matched