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

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

Re: regexp problems the evil \[


From: Uwe Brauer
Subject: Re: regexp problems the evil \[
Date: Thu, 23 Mar 2017 22:11:29 +0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)

>>> "Stefan" == Stefan Monnier <address@hidden> writes:

   >> (query-replace "\\[" "\\begin{displaymath}\n" nil)
   >      ^^^^^^^^^^^^^^^^^^^
   >      matches \[

   >> (query-replace-regexp "\\[\\([^}]+\\)\\]" "@\\1" nil))
   >      ^^^^^^^^^^^^^^^^^^^^^^^^^
   >         matches [

   > Since [ in regexps has otherwise a special meaning.
   > To match \[ and \] you'll want

   >    (query-replace-regexp "\\\\\\[\\([^}]+\\)\\\\\\]" "@\\1" nil))

Wow six \ I gave up after five.

Thanks

Uwe 




reply via email to

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