GNU bug report logs - #37659
rx additions: anychar, unmatchable, unordered-or

Previous Next

Package: emacs;

Reported by: Mattias Engdegård <mattiase <at> acm.org>

Date: Tue, 8 Oct 2019 09:37:01 UTC

Severity: wishlist

Tags: fixed, patch

Fixed in version 27.1

Done: Mattias Engdegård <mattiase <at> acm.org>

Bug is archived. No further changes may be made.

Full log


Message #37 received at 37659 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Mattias Engdegård <mattiase <at> acm.org>
Cc: 37659 <at> debbugs.gnu.org
Subject: Re: bug#37659: rx additions: anychar, unmatchable, unordered-or
Date: Wed, 23 Oct 2019 16:14:45 -0700
On 10/23/19 2:15 AM, Mattias Engdegård wrote:

> how do we make it easy to match one of multiple strings --- keywords, say --- in rx?

If that's the real problem, perhaps the name should be "or-tokens" or 
something like that, to help remind the reader of the limitations of the 
proposed operator: it's meant only for greedy tokenization and it isn't 
suited for regular expressions in general. A problem with the name 
"or-max" is that it implies a more-general functionality than the 
implementation really has.

What happens if you apply or-tokens to arguments that aren't strings or 
other or-tokens? Does rx diagnose this? I hope it does.

> We could say that 'or' and \| either match greedily or in left-to-right order. However, I'm not sure this solves any problem right now.

I was thinking of something more-compatible: we could say that \| is 
left-to-right (for users who need compatibility with regexp "|"), and 
that 'or' is not necessarily left-to-right (to make room for future 
extensions that make 'or' greedy, or more efficient, or both).




This bug report was last modified 5 years and 81 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.