[Top][All Lists]

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

Re: Ugly regexps

From: Helmut Eller
Subject: Re: Ugly regexps
Date: Wed, 03 Mar 2021 08:09:17 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

On Tue, Mar 02 2021, Stefan Monnier wrote:

> BTW, while this theme of ugly regexps keeps coming up, how 'bout we add
> a new function `ere` which converts between the ERE style of regexps
> where grouping parens are not escaped (and plain chars meant to match
> an actual paren need to be escaped instead) to ELisp-style regexps?
> So you can do
>     (string-match (ere "\\(def(macro|un|subst) .{1,}"))

Better call it (rx (ere STRING)).  Namespace pollution may not be
prohibited by the law but mother Emacs may thank you anyway :-)


reply via email to

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