emacs-devel
[Top][All Lists]
Advanced

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

Re: rx.el sexp regexp syntax


From: Eric Abrahamsen
Subject: Re: rx.el sexp regexp syntax
Date: Sat, 02 Jun 2018 12:33:18 -0700
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

Stefan Monnier <address@hidden> writes:

>> brutal regexp, but what I *would* use all day long would be a macro that
>> un-escaped backslashes for me. Ideally:
>
> That'd be a good first step.
> A second important step would be to easily embed comments and Elisp code
> (mostly references to other Elisp variables).

I played around with this, but it might not be possible to achieve
enough of the conveniences to make it worthwhile. I wanted to partially
reverse the sense of the backslash -- "(" would be translated to "\\("
-- but also to write backslash specials with a single backslash: ie the
first group reference could actually be written as "\1", rather than
"\\1". Of course, the string reader interprets that as a control
character, and I doubt there's any way around that, at least not in
lisp.

It's still nice to be able to write "\\(cat\\|dog\\)" as "(cat|dog)",
but I'm not sure it's worth it.




reply via email to

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