fork download
  1. #include <iostream>
  2. #include <regex>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main(int argc, char* argv[])
  8. {
  9. string text = "\\left( 0 + 1 \\right)";
  10. text = regex_replace(text, regex(R"(\\(left(?=\()|right(?=\))))"), "");
  11. cout << text;
  12. return 0;
  13. }
Success #stdin #stdout 0.01s 5444KB
stdin
Standard input is empty
stdout
( 0 + 1 )