- // The '$' must be prefixed with the escape character '\' for
- // boost to treat it as a literal.
- // Thus, to prefix a matched expression with '\', we use:
- return lyx::regex_replace(expr, reg, "\\\\$&");
+ // To prefix a matched expression with a single literal backslash, we
+ // need to escape it for the C++ compiler and use:
+ return regex_replace(expr, reg, "\\$&");