emacs-devel
[Top][All Lists]
Advanced

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

Re: modern regexes in emacs


From: Clément Pit-Claudel
Subject: Re: modern regexes in emacs
Date: Fri, 15 Feb 2019 09:10:26 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

On 15/02/2019 08.42, Philippe Vaucher wrote:
> Would this even be possible? I can imagine a whole lot of packages breaking 
> if the regexp syntax changed, and changing it just for the user input in 
> interactive functions looks a bit sketchy.

We could just add a special tag at the beginning of a regexp to indicate that 
it's a pcre regexp; something like this maybe? (re-search-forward 
"\\(?pcre:\\)…[pcre regexp goes here]…").  This form is currently a syntax 
error, so there would be no ambiguity, and we could define a (pcre …) macro so 
that you could write (re-search-forward (pcre "…[pcre regexp goes here]…")) 
instead.  Alternatively, we could use an explicit tag, something like 
(re-search-forward (cons 'pcre "…[pcre regexp goes here]…")).

For interactive functions, I imagine you'd have a defcustom with a preferred 
regexp dialect.



reply via email to

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