
6 Mar
2011
6 Mar
'11
11:16 a.m.
On Wed, Mar 2, 2011 at 5:43 PM, Jim Bell <Jim@jc-bell.com> wrote:
On 1:59 PM, John Maddock wrote:
To your point of escaping a string wrong, I fiddled with a regex_replace() that would remove all '\E' (end-of-quoted-sequence), including '\\\E', but not touch '\\E' (i.e., even numbers of '\' prefixing), and couldn't get it.
I'm not sure I understand what you're trying to achieve there, can you explain?
I was going for different form, but (hopefully) same result as yours:
std::string my_escaped_string = "\\Q" + regex_replace(my_string, e, "\\\\$&") + "\\E";
I use something like "\\Q" + boost::replace_all_copy(text, "\\E", "\\E\\\\E\\Q") + "\\E" Yechezkel Mett