[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: query-replace-regexp ... "Invalid repacement string '\.'"
From: |
David Kastrup |
Subject: |
Re: query-replace-regexp ... "Invalid repacement string '\.'" |
Date: |
Mon, 25 Sep 2006 08:55:13 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
"s. keeling" <keeling@spots.ab.ca> writes:
> Hi. I was trying to make it easy on myself using q-r-r replacing
> '[^\]\.' (not a backslash, followed by a literal dot/period) with the
> string (sans quotes) '\.', essentially "escaping" every dot/period in
> the file. "M-x query-replace" had no trouble with it but M-x
> query-replace-regexp refused, spouting the error message in the
> subject.
>
> So how do you replace '.' with '\.' in emacs? Googling's
> (groups.google.com) turned up nothing useful (interesting, but not
> useful). I tried variations of '\\\.' (literal backslash followed by
> literal period) to no effect.
>
> Suggestions or pointers welcome. Thanks.
M-x query-replace-regexp RET \. RET \\. RET
. is not special in the replacement string. You can also write
M-x query-replace-regexp RET \. RET \\\& RET
--
David Kastrup, Kriemhildstr. 15, 44793 Bochum