[Top][All Lists]

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

Re: rx.el sexp regexp syntax

From: Peter Neidhardt
Subject: Re: rx.el sexp regexp syntax
Date: Sat, 26 May 2018 01:32:11 +0200
User-agent: mu4e 1.0; emacs 26.1

Michael Heerdegen <address@hidden> writes:

>>  A string regexp, by contrast, usually fits onto a single line.
> But regexps are tree-like structures.  That's why rx, which uses sexps
> (i.e. trees), is the easier to read representation for complicated
> regexps than a one-dimensional string.  Unless you have the ability to
> form a representation in your head.

I did not think of this at first but I think it's an excellent,
fundamental point.

>> The "English" counterpart used in rx is bulky and difficult to learn.
>> Somehow, you've got to learn that it's "word-start" and not
>> "word-beginning", that it's "not" and not "non", and so on.
> That's IMHO the main reason why people avoid using rx.  I wonder if that
> aspect of rx could be improved (why not just use $ as synonym for bol
> etc.)?

I guess you meant 'eol' ;)

rx supports synonyms and I think in general it's not a good idea.
That said, I really like that it uses meaningful words.  So instead of

        ‘line-end’, ‘eol’

I'd leave it to only


Peter Neidhardt

Attachment: signature.asc
Description: PGP signature

reply via email to

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