help-gnu-emacs
[Top][All Lists]
Advanced

[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 08:33:32 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (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.

In a regexp for a "\" you need to escape, so write "\\". "\]" is a
mistake.
A correct regexp for your intention should be
'[^\\]\.'
   --

> So how do you replace '.' with '\.' in emacs?

That should be fine.

> Suggestions or pointers welcome.  Thanks.

HTH

Malte


reply via email to

[Prev in Thread] Current Thread [Next in Thread]