[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
More re odditie [Was: regular expressions that match nothing]
From: |
phs |
Subject: |
More re odditie [Was: regular expressions that match nothing] |
Date: |
Thu, 16 May 2019 08:57:18 +0200 |
User-agent: |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 |
While testing how rx handles the new regexp-unmatchable construct, I
stumbled on some odd emacs behavior.
The regular expression "*", instead of matching zero-or-more occurrences
of the empty string, behaves as "\*" or "[*]" and only matches the *
character.
I believe this is a bug, not a feature, and in any case the Emacs manual
does not document this behavior.
Perhaps it is not a bug in Emacs per se, rather a bug in the gnulib
regex library so I'll wait for comments before submitting a bug report...
If this behavior is the expected one, then (rx (0+ "")) should not
return "*".
We have the same problem with "+" and (rx (1+ "")).
-phs
On 2019/05/15 23:07, Mattias Engdegård wrote:
> 15 maj 2019 kl. 22.17 skrev Michael Heerdegen <address@hidden>:
>> Should there be an rx regexp form for this?
> We don't necessarily need a special form for it; we can just make `(or)' work.
>
> Proposed patch attached. (I also added its dual, (seq), since it would be
> silly not to.)
>
- Re: regular expressions that match nothing, (continued)
- Re: regular expressions that match nothing, Alan Mackenzie, 2019/05/15
- Re: regular expressions that match nothing, Mattias Engdegård, 2019/05/16
- Re: regular expressions that match nothing, Phil Sainty, 2019/05/16
- Re: regular expressions that match nothing, Alan Mackenzie, 2019/05/17
- Re: regular expressions that match nothing, Mattias Engdegård, 2019/05/17
- Re: regular expressions that match nothing, Stefan Monnier, 2019/05/17
- Re: regular expressions that match nothing, Michael Heerdegen, 2019/05/15
- Re: regular expressions that match nothing, Stefan Monnier, 2019/05/15
- Re: regular expressions that match nothing, Mattias Engdegård, 2019/05/15
- Re: regular expressions that match nothing, Michael Heerdegen, 2019/05/15
- More re odditie [Was: regular expressions that match nothing],
phs <=
- Re: More re odditie [Was: regular expressions that match nothing], Mattias Engdegård, 2019/05/16
- Re: More re odditie [Was: regular expressions that match nothing], phs, 2019/05/16
- Re: More re odditie [Was: regular expressions that match nothing], Stefan Monnier, 2019/05/16
- Re: More re odditie [Was: regular expressions that match nothing], Michael Heerdegen, 2019/05/16
- Re: More re odditie [Was: regular expressions that match nothing], Mattias Engdegård, 2019/05/16
- Global and local definitions of non-functions/variable (was: More re odditie [Was: regular expressions that match nothing]), Stefan Monnier, 2019/05/16
- Bootstrap/autoload policy (was Re: regular expressions that match nothing), Mattias Engdegård, 2019/05/20
- Re: Bootstrap/autoload policy (was Re: regular expressions that match nothing), Stefan Monnier, 2019/05/22
- Re: Bootstrap/autoload policy (was Re: regular expressions that match nothing), Mattias Engdegård, 2019/05/22
- Re: Bootstrap/autoload policy (was Re: regular expressions that match nothing), Stefan Monnier, 2019/05/22