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.
_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-devel