emacs-devel
[Top][All Lists]
Advanced

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

Re: Regular expression creation [was: Re: Emacs Lisp's future]


From: Alexis
Subject: Re: Regular expression creation [was: Re: Emacs Lisp's future]
Date: Fri, 19 Sep 2014 20:07:05 +1000

Stefan Monnier writes:

>> debates around raw strings, i still feel something like Stefan's
>> suggestion for a built-in `re-escape` function would probably solve most
>> of the issues i have with ELisp REs.
>
> And note that re-escape should be easy to write.  I guess the main issue
> would be to decide what escape character to use (assuming "(" is used for
> regexp-grouping, what should be used to match a plain open-parenthesis?
> "\(" is not an option since it's the same string as "(", so you either
> have to go with "\\(" which (as we know) sucks, or choose another escape
> char than backslash).

Hmm, good point .... Perhaps "!" could be the escape character? It seems
to me like a character that might be less likely to need to be literally
matched (or matched less frequently) than other visible ASCII
characters, and also seems to me to be reasonably memorable for this
purpose ....


Alexis.



reply via email to

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