fork(13) download
  1. #include <regex>
  2. #include <string>
  3. #include <iostream>
  4. using namespace std;
  5.  
  6. int main() {
  7. std::string regexp_string(R"(([a-z])\1)");
  8. std::regex regexp_to_match(regexp_string);
  9. std::string target("abbab");
  10. std::smatch matched_regexp;
  11. if (std::regex_search(target, matched_regexp, regexp_to_match)) {
  12. std::cout << matched_regexp.str() << std::endl;
  13. }
  14. return 0;
  15. }
Success #stdin #stdout 0s 16160KB
stdin
Standard input is empty
stdout
bb