fork(4) download
  1. #include <iostream>
  2. #include <regex>
  3. #include <string>
  4. using namespace std;
  5.  
  6. int main() {
  7. regex rex(R"(([\s\S]*)<FooBar>)");
  8. string s("abcde\n fghij<FooBar>");
  9. smatch m;
  10. if (regex_search(s, m, rex)) {
  11. std::cout << m.str(1) << std::endl;
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 15336KB
stdin
Standard input is empty
stdout
abcde
		fghij