In article <mailman.3295.1169191738.2155.help-gnu-emacs@gnu.org>,
Kevin Rodgers <kevin.d.rodgers@gmail.com> wrote:
See the LITERAL argument in the doc string for replace-regexp-in-string:
(replace-regexp-in-string "/" "\\" "c:/emacs/lisp/" nil t)
Or
(replace-regexp-in-string "/" "\\\\" "c:/emacs/lisp/")
This is necessary because backslash is an escape character at two
levels: Lisp strings and regexp replacement strings (e.g. the sequence
\1 in the replacement represents a group matched in the regexp). So the
replacement string needs to be \\, and you need to escape each \ in the
string.