[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Regular expression creation [was: Re: Emacs Lisp's future]
From: |
Daniel Colascione |
Subject: |
Re: Regular expression creation [was: Re: Emacs Lisp's future] |
Date: |
Fri, 19 Sep 2014 11:04:41 -0700 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.1.1 |
On 09/18/2014 02:54 PM, Alexis wrote:
>
> Daniel Colascione writes:
>
>> On 09/17/2014 07:07 PM, Alexis wrote:
>>> i like this suggestion. i'm rather comfortable with Perl5 REs, and can
>>> find myself frustrated trying to create REs in ELisp. Having said that,
>>> the issue is not usually the syntax of ELisp REs per se (e.g. needing to
>>> escape things like capturing parentheses or the alternatives pipe); it's
>>> needing to escape various things /further/ because REs can only be
>>> specified in the form of a standard ELisp string. On several occasions
>>> i've ended up using a combination of pcre-to-elisp and re-builder to try
>>> to work out if the problem is too few backslashes, too many backslashes,
>>> or both.
>>
>> That's why we have rx.
>
> i find rx .... unwieldy. For me, rx is to PCREs as a putative function
> 'apply-function-to-each-element-of-sequence' is to 'mapcar'. i don't
> want an English-language wrapper for regular expressions; i want regular
> expressions that don't suffer from backslashitis. And, given the several
> discussions by a number of people over the last several months -
> including recently - about alternatives to the current RE-creation
> system in Emacs, it seems to me that rx is hardly the final piece of the
> Emacs Lisp RE puzzle.
rx is sometimes awkward for small patterns, but it's a boon for larger
ones: see the work I did in compile.el, which involved rewriting the
"gnu" pattern with rx. It's also pretty easy to embed string regular
expressions inside rx forms.
Anyway, I'd love to see pcre2el or equivalent in core. It's a nice
packing for converting between regular expression formats.
signature.asc
Description: OpenPGP digital signature
- Re: Emacs Lisp's future, (continued)
- Re: Emacs Lisp's future, Lars Brinkhoff, 2014/09/17
- Re: Emacs Lisp's future (was: Guile emacs thread (again)), Lally Singh, 2014/09/17
- Re: Emacs Lisp's future (was: Guile emacs thread (again)), Alexis, 2014/09/17
- Re: Emacs Lisp's future, Daniel Colascione, 2014/09/18
- Regular expression creation [was: Re: Emacs Lisp's future], Alexis, 2014/09/18
- Re: Regular expression creation [was: Re: Emacs Lisp's future], Aurélien Aptel, 2014/09/18
- Re: Regular expression creation [was: Re: Emacs Lisp's future], Alexis, 2014/09/18
- Re: Regular expression creation [was: Re: Emacs Lisp's future], Stefan Monnier, 2014/09/18
- Re: Regular expression creation [was: Re: Emacs Lisp's future], Alexis, 2014/09/19
- Re: Regular expression creation [was: Re: Emacs Lisp's future], Filipp Gunbin, 2014/09/26
- Re: Regular expression creation [was: Re: Emacs Lisp's future],
Daniel Colascione <=
- Re: Emacs Lisp's future, Andreas Röhler, 2014/09/18
- Re: Emacs Lisp's future, Richard Stallman, 2014/09/18
- Re: Emacs Lisp's future, Ivan Andrus, 2014/09/18
- Re: Emacs Lisp's future, Richard Stallman, 2014/09/18
- Re: Emacs Lisp's future, Andreas Röhler, 2014/09/19
- Re: Emacs Lisp's future, Andreas Schwab, 2014/09/19
- Re: Emacs Lisp's future, David Kastrup, 2014/09/19
- Re: Emacs Lisp's future (was: Guile emacs thread (again)), Emilio Lopes, 2014/09/18
Re: Emacs Lisp's future (was: Guile emacs thread (again)), Eli Zaretskii, 2014/09/16
Re: Emacs Lisp's future (was: Guile emacs thread (again)), Lars Brinkhoff, 2014/09/16