fork(14) download
  1. #include <regex>
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8. string input =R"(This text is <ul>pretty long, but will be
  9. concatenated into just a single string.
  10. The disadvantage is that you have to quote
  11. each part, and </ul>newlines must be literal as
  12. usual.)";
  13.  
  14. string regx = R"(<ul>([\s\S]*?)<\/ul>)";
  15. smatch matches;
  16. if (regex_search(input, matches, regex(regx)))
  17. {
  18. cout<<matches[1]<<"."<<endl;
  19. }
  20.  
  21. return 0;
  22. }
Success #stdin #stdout 0s 4452KB
stdin
Standard input is empty
stdout
pretty long, but will be 
	  concatenated into just a single string. 
	   The disadvantage is that you have to quote 
	  each part, and .