fork(2) download
  1. #include <iostream>
  2. #include <regex>
  3. using namespace std;
  4.  
  5. int main() {
  6. std::string str = "\"Hello people \" how are you doing \" what are \" you upto \"";
  7. str = std::regex_replace(str, std::regex("(?!^)\"(?!$)"), "&quot;");
  8. std::cout << str << std::endl;
  9. return 0;
  10. }
Success #stdin #stdout 0s 15336KB
stdin
Standard input is empty
stdout
"Hello people &quot; how are you doing &quot; what are &quot; you upto "