> According to this:
> http://dlang.org/phobos/std_**regex.html#.replace<http://dlang.org/phobos/std_regex.html#.replace>
> you
can use the same escape sequences for both (\c -> c in the replacement
string).
Your suggestion does not work; try for yourself by replacing the $$ by \$
in my code. Is that a bug in std.regex' doc?
eg:
replace("",regex(``),`\$`);
=> invalid format string in regex replace
However everything works fine with $$, see my code above.
On Thu, May 30, 2013 at 1:14 AM, Diggory <[email protected]> wrote:
> On Thursday, 30 May 2013 at 06:50:06 UTC, Timothee Cour wrote:
>
>> ok, here it is:
>>
>> https://github.com/**timotheecour/dtools/blob/**
>> master/dtools/util/util.d#L78<https://github.com/timotheecour/dtools/blob/master/dtools/util/util.d#L78>
>> simplified implementation and added missing escape symbols. Any symbol
>> missing?
>> I was basing myself based on
>> http://dlang.org/phobos/std_**regex.html<http://dlang.org/phobos/std_regex.html>,
>> table
>> entry '\c where c is one of', but that was incomplete. I'm also noting
>> that
>> table entry 'any character except' is also incomplete.
>>
>> Technically any working "escapeRegex" would also function as a valid
>>>
>> "escapeRegexReplace", although it might be slightly faster to have a
>> specialised one.
>>
>> not sure, because they escape differently (\$ vs $$).
>>
>
> According to this:
> http://dlang.org/phobos/std_**regex.html#.replace<http://dlang.org/phobos/std_regex.html#.replace>you
> can use the same escape sequences for both (\c -> c in the replacement
> string).
>