From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lennart Borgman Newsgroups: gmane.emacs.devel Subject: Re: replace-regexp-in-string bug? Date: Sat, 13 Aug 2005 14:37:41 +0200 Message-ID: <42FDE995.4040204@student.lu.se> References: <42FDE4CD.6080000@student.lu.se> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1123938200 3090 80.91.229.2 (13 Aug 2005 13:03:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 13 Aug 2005 13:03:20 +0000 (UTC) Cc: Emacs Devel Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Aug 13 15:03:18 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1E3vez-0002g3-3K for ged-emacs-devel@m.gmane.org; Sat, 13 Aug 2005 15:02:49 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E3viF-0003Ok-Eg for ged-emacs-devel@m.gmane.org; Sat, 13 Aug 2005 09:06:11 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E3vi0-0003OP-62 for emacs-devel@gnu.org; Sat, 13 Aug 2005 09:05:56 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E3vhy-0003NG-Jf for emacs-devel@gnu.org; Sat, 13 Aug 2005 09:05:55 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E3veJ-0001cI-If for emacs-devel@gnu.org; Sat, 13 Aug 2005 09:02:07 -0400 Original-Received: from [81.228.8.164] (helo=pne-smtpout2-sn2.hy.skanova.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1E3vVV-0005UX-D8 for emacs-devel@gnu.org; Sat, 13 Aug 2005 08:53:01 -0400 Original-Received: from [192.168.123.121] (83.249.204.240) by pne-smtpout2-sn2.hy.skanova.net (7.2.060.1) id 42B94E29007FB26E for emacs-devel@gnu.org; Sat, 13 Aug 2005 14:37:42 +0200 User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en In-Reply-To: <42FDE4CD.6080000@student.lu.se> X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:41996 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:41996 Lennart Borgman wrote: > I want to create a regexp out of an unknown string with spaces. I am > not sure about the number of spaces in the actual string to match so I > want to do a replacement like this: > > (replace-regexp-in-string "\s-+" "\s-+" "some space" nil t) > > However this returns "some space" instead of "some\s-+space" which I > expected. Is this a bug or am I misunderstanding the arguments in some > way? No, it was not a bug. I have to count my \. This works as expected using (replace-regexp-in-string "\\s-+" "\\s-+" "some space" nil t) Sorry for the noise.