Looks like regex_replace is only replacing the left parenthesis. And that too is not without a backslash:
#include <iostream>
#include <regex>
#include <string>
using namespace std;
int main(int argc, char* argv[])
{
string text = "\\left( 0 + 1 \\right)";
text = regex_replace(text, regex("\\left\\("), "(");
text = regex_replace(text, regex("\\right\\)"), ")");
cout << text;
return 0;
}
The output is:
\( 0 + 1 \right)
The expected output is:
( 0 + 1 )