fork download
  1. #include <iostream>
  2. #include <string>
  3. #include <regex>
  4. using namespace std;
  5. int main() {
  6. string line;
  7. regex pattern("o(go)+");
  8. while (getline(cin, line))
  9. cout << regex_replace(line, pattern, "***") << endl;
  10. return 0;
  11. }
Success #stdin #stdout 0s 3564KB
stdin
chenfyogogogogooooo
stdout
chenfy***oooo