Convert a string to emacs regexp

Emacs
Author

Vinh Nguyen

Published

June 29, 2011

Suppose you want to convert a string (e.g., "\") to an emacs regexp representation. Then do evaluate the lisp code: (regexp-quote "\^{}"), which would yield \\\^{}. Remember, you can evaluate elisp with M-:.