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