[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: query-replace-regexp ... "Invalid repacement string '\.'"
From: |
Malte Spiess |
Subject: |
Re: query-replace-regexp ... "Invalid repacement string '\.'" |
Date: |
Mon, 25 Sep 2006 09:17:53 +0200 |
User-agent: |
Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) |
David Kastrup <dak@gnu.org> writes:
> "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
That would not work if there already is a "\" in the text. Your other
proposal is much better IMHO. (I think he does not want "\." to be
replaced with "\\.".)
I guess you just wanted to describe the general concept, this is just to
prevent confusion for other readers.
Greetings
Malte