Path: utzoo!mnetor!uunet!yale!Ram-Ashwin From: Ram-Ashwin@cs.yale.edu (Ashwin Ram) Newsgroups: comp.emacs Subject: Re: GNU Emacs string modification question Message-ID: <27999@yale-celray.yale.UUCP> Date: 27 Apr 88 15:07:17 GMT References: <11715@tut.cis.ohio-state.edu> Sender: root@yale.UUCP Reply-To: Ram-Ashwin@cs.yale.edu (Ashwin Ram) Organization: Computer Science, Yale University, New Haven, CT 06520-2158 Lines: 21 In-reply-to: karl@tut.cis.ohio-state.edu (Karl Kleinpaste) In article <11715@tut.cis.ohio-state.edu>, karl@tut (Karl Kleinpaste) writes: > Can anyone give > me a simple function which takes a string argument and inserts > backslashes (\) in front of RE-special characters within the string? Try: regexp-quote: Return a regexp string which matches exactly STRING and nothing else. For example: (regexp-quote "comp.lang.c++") "comp\\.lang\\.c\\+\\+" -- Ashwin. ARPA: Ram-Ashwin@cs.yale.edu UUCP: {decvax,ucbvax,harvard,cmcl2,...}!yale!Ram-Ashwin BITNET: Ram@yalecs