From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Malte Spiess Newsgroups: gmane.emacs.help Subject: Re: query-replace-regexp ... "Invalid repacement string '\.'" Date: Mon, 25 Sep 2006 09:17:53 +0200 Organization: Arcor Message-ID: <87d59k2z4u.fsf@trick.ulm.malte.spiess> References: <85zmcol9ke.fsf@lola.goethe.zz> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1159170450 17745 80.91.229.2 (25 Sep 2006 07:47:30 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Mon, 25 Sep 2006 07:47:30 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Sep 25 09:47:28 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GRlBP-0000i5-1t for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Sep 2006 09:47:21 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GRlBO-00022k-1B for geh-help-gnu-emacs@m.gmane.org; Mon, 25 Sep 2006 03:47:18 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!lnewsinpeer00.lnd.ops.eu.uu.net!bnewsinpeer00.bru.ops.eu.uu.net!emea.uu.net!newsfeed.arcor.de!newsspool1.arcor-online.net!news.arcor.de.POSTED!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) Cancel-Lock: sha1:pCgc/wPZMbGoAn8OhiuO9eKlJbI= Original-Lines: 30 Original-NNTP-Posting-Date: 25 Sep 2006 09:17:46 CEST Original-NNTP-Posting-Host: fcdf85f0.newsspool3.arcor-online.net Original-X-Trace: DXC=jbUODjTY; ZUmG86`U=_nC_McF=Q^Z^V3X4Fo<]lROoRQ4nDHegD_]RUKHXkc=IU6CRjQd8 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37604 Archived-At: David Kastrup writes: > "s. keeling" 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