help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: elisp: Replacing dots in strings (. -> \.)


From: Eric Hanchrow
Subject: Re: elisp: Replacing dots in strings (. -> \.)
Date: Sun, 08 Jul 2007 08:07:00 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1.50 (gnu/linux)

    Jeronimo Pellegrini <j_p@aleph0.info> wrote:
    > (replace-regexp-in-string "\\." "\\\." "aaa . bbb" t t)
    >       ==> "aaa \\. bbb"

To preserve your sanity, and that of anyone who reads your code, I beg
you to use the fabulous "rx" package (it's already in your Emacs --
nothing to install!)

(replace-regexp-in-string (rx ".") "\\." "aaa . bbb" t t)
            ==> "aaa \\. bbb"

-- 
Покажи мне твой .emacs, и я скажу, кто ты.
        -- Russian Proverb





reply via email to

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