[Top][All Lists]

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

Re: regular expressions that match nothing

From: Mattias Engdegård
Subject: Re: regular expressions that match nothing
Date: Thu, 16 May 2019 12:54:30 +0200

15 maj 2019 kl. 21.41 skrev Alan Mackenzie <address@hidden>:
> I think regexp-unmatchable is too much of a mouthful.  It is more
> difficult to type that a\\` (or whatever), even after having to think
> where the seldom used keys are on the keyboard.  Also it is difficult to
> spell.  is it unmatchable or unmatcheable?
> I would suggest re-nomatch (or possibly nomatch-re), which is just 10
> characters, as opposed to your suggestion which is 18.  Quite possibly,
> re-nomatch is easier to type than a\\` (or whatever).

Thanks Alan, and you may have a point. I'm definitely not against a better name 
if there is a consensus for it.
Let me just dispassionately note that:

1. As 'match' does not end in 'e', there is no more reason to write
   'unmatcheable' than 'undrinkeable'.

2. (rx (or)) is even shorter than re-nomatch, and is very memorable.
   (rx (|)) is shorter still.

3. Lisp tradition is unafraid of the verbose, partly because `-' is
   allowed in identifiers which lowers the friction.

4. The point of this name isn't to be shorter than the regexp string
   it represents, but to be more readable and avoid mistakes and
   substandard reinventions.

Start bikeshedding; I'll try to low-pass filter.

reply via email to

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