[Top][All Lists]

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

Re: modern regexes in emacs

From: Mattias Engdegård
Subject: Re: modern regexes in emacs
Date: Fri, 15 Feb 2019 17:24:18 +0100

15 feb. 2019 kl. 15.18 skrev Eli Zaretskii <address@hidden>:
> It should be possible if we introduce new functions for PCRE, or if we
> mark PCRE regexps in some special way, like put a special text
> property on the string.

It would be easier if those who ask for PCRE would say exactly what they want:

(1) The syntax of PCRE -- | () {} instead of \| \(\) \{\} etc -- but restricted 
to the set of features of the Emacs regexp engine.
(2) The features of PCRE not present in Emacs regexps. Which ones, exactly? 
Lookbehind assertions? Atomic groups?
(3) PCRE for interactive use only.
(4) PCRE for general Elisp programming.

Locating and wrapping the places that ask for regexps interactively, such as 
`query-replace-regexp', would permit the interactive regexp syntax to become a 
simple user customisation -- traditional, PCRE, rx or whatnot. It would be a 
matter of writing a transformation function, and possibly some syntax 
highlighting, for each case.

I wouldn't be surprised if 99% of the requests are really about not having to 
escape |(){} as metacharacters in interactive use.

reply via email to

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