From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?ISO-8859-1?Q?Andreas_R=F6hler?= Newsgroups: gmane.emacs.help Subject: Re: reduce repeated backslashes Date: Mon, 15 Feb 2010 12:55:49 +0100 Message-ID: <4B793645.3060800@easy-emacs.de> References: <87ljeuc25r.fsf@mithlond.arda> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1266234889 15887 80.91.229.12 (15 Feb 2010 11:54:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Feb 2010 11:54:49 +0000 (UTC) Cc: Peter Dyballa , help-gnu-emacs@gnu.org, thierry.volpiatto@gmail.com To: Teemu Likonen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Feb 15 12:54:45 2010 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1NgzXG-0007v8-Pz for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Feb 2010 12:54:43 +0100 Original-Received: from localhost ([127.0.0.1]:57536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NgzXG-0001NV-2Y for geh-help-gnu-emacs@m.gmane.org; Mon, 15 Feb 2010 06:54:42 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NgzWt-0001Mk-RW for help-gnu-emacs@gnu.org; Mon, 15 Feb 2010 06:54:19 -0500 Original-Received: from [140.186.70.92] (port=39156 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NgzWt-0001MT-Ci for help-gnu-emacs@gnu.org; Mon, 15 Feb 2010 06:54:19 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NgzWs-0001aX-LJ for help-gnu-emacs@gnu.org; Mon, 15 Feb 2010 06:54:19 -0500 Original-Received: from moutng.kundenserver.de ([212.227.126.171]:63607) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NgzWs-0001aJ-7u for help-gnu-emacs@gnu.org; Mon, 15 Feb 2010 06:54:18 -0500 Original-Received: from [192.168.178.27] (p54BE89BC.dip0.t-ipconnect.de [84.190.137.188]) by mrelayeu.kundenserver.de (node=mreu2) with ESMTP (Nemesis) id 0M3OHE-1NynOI0tn6-00rLhB; Mon, 15 Feb 2010 12:53:59 +0100 User-Agent: Thunderbird 2.0.0.19 (X11/20081227) In-Reply-To: <87ljeuc25r.fsf@mithlond.arda> X-Provags-ID: V01U2FsdGVkX1+/Rmh2NDEjQgpmVQ9z5ar/TDbXeto9znaQCIn DfDjAPG9kEIYjl/Wj3MMTpdZkXZZOdaLcGk42hS4ngD3XtTyEC oH48nYIH6858v36nZV3binYHjGPz5exoau/brY3uA8= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor 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:71870 Archived-At: Teemu Likonen wrote: > * 2010-02-15 09:40 (+0100), Andreas Roehler wrote: > >> don't know how to replace/reduce repeated backslashes from inside a >> string. >> >> Let's assume "abcdef\\\\" > > What is the end result you want? I guess: > > (replace-regexp-in-string "\\\\\\\\" "\\" "abcdef\\\\" nil t) > => "abcdef\\" > > There are 8 backslashes in the regexp string because backslash is a meta > character in Lisp strings and also in regexps. 8 backslashes in a regexp > Lisp string means 2 literal backslashes. In the resulting string there > is only one backslash but it is displayed as two "\\" because it's a > printed representation of Lisp string. > Thanks all! Andreas