This causes errors when the script tries to use gsub to restore
the double backslashes on these implementations. There seems to
be no trouble substiting "\\" to get a single backslash, so we
can work around the problem by doubling up the characters being
replaced instead (which additionally requires an adjustment to
the length calculations to reverse this).