fork(5) download
  1. #include <regex>
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string regx = R"(^\d{1,2}(\.\d{1,2})+$)";
  9. string input = "1.2.346";
  10. smatch matches;
  11. if (regex_search(input, matches, regex(regx)))
  12. {
  13. cout<<"match found";
  14. }
  15. else
  16. cout<<"No match found";
  17. return 0;
  18. }
Success #stdin #stdout 0s 15352KB
stdin
Standard input is empty
stdout
No match found