emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: replace-regexp-in-string bug?


From: Lennart Borgman
Subject: Re: replace-regexp-in-string bug?
Date: Sat, 13 Aug 2005 14:37:41 +0200
User-agent: Mozilla Thunderbird 1.0.6 (Windows/20050716)

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.




reply via email to

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