fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <regex>
  4.  
  5. int main()
  6. {
  7. std::string txt("some program code SAMPLE_SIGN text inside the\r\nsample SAMPLE_SIGN");
  8. std::smatch m;
  9. std::regex rt("SAMPLE_SIGN([\\S\\s]+)(?=SAMPLE_SIGN)");
  10. std::regex_search(txt, m, rt);
  11.  
  12. std::cout << m.str(1) << std::endl;
  13. }
Success #stdin #stdout 0s 15336KB
stdin
Standard input is empty
stdout
 text inside the
sample