suppress handling of special characters in replacement text#20
suppress handling of special characters in replacement text#20chesles wants to merge 3 commits intomrtazz:masterfrom
Conversation
|
Oh good catch, thanks for this! Do you know if there is a corresponding flag for C++11? I'm planning to merge #19 and remove the boost dependency so it would be nice to not regress on this. But I'll anyway make sure to merge this before I remove boost, as there will be a last release depending on boost anyways. That way we have this fixed at least. |
|
I'm not sure about a C++11 flag, I'll look into it and see if I can find one. Doing a release with this fix before #19 gets merged sounds like a good approach to me. |
|
It looks like there's not a corresponding flag for this in C++11 - the format string is controlled by the However, by default Here's a diff against #19 that implements this (and also removes code that seems to replace |
Given replacement text with special characters like
$,(,),\, and probably others, the call toregex_replacewas handling these - lines 107-117 seem to be a workaround for\, but using theboost::regex_constants::format_literalto suppress handling of all special characters in the replacement text seems like a better solution.See also #17 and boost replace options documentation.