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: Aurélien Aptel
Subject: Re: regexp problems the evil \[
Date: Fri, 24 Mar 2017 00:38:18 +0100

On Thu, Mar 23, 2017 at 11:11 PM, Uwe Brauer <address@hidden> wrote:
> Wow six \ I gave up after five.

Yes, it's ridiculous, I personally think emacs lisp regexes are
unusable once escapes are involved, especially interactively.
You can use rx instead of strings to make regexes from s-expressions.
Strings elements are always assumed to match literally (rx will always
escape whatever is needed to match the string literally).

    (query-replace-regexp (rx "\\[" (group (+ (not (any "}")))) "\\]") ...



reply via email to

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