fork(3) download
  1. #include<regex>
  2. using namespace std;
  3. int main()
  4. {
  5. regex e("auth");
  6. smatch m;
  7. string s="Connected to a:b:c:d completed auth id=3, str=3";
  8. //string s="auth";
  9.  
  10. bool match = regex_search(s,e);
  11. if( match == true )
  12. printf("matched");
  13. else
  14. printf("no match");
  15. }
Success #stdin #stdout 0s 3360KB
stdin
Standard input is empty
stdout
matched