|
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 <monnier@iro.umontreal.ca> 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
[Prev in Thread] | Current Thread | [Next in Thread] |