[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: More re odditie [Was: regular expressions that match nothing]
From: |
Mattias Engdegård |
Subject: |
Re: More re odditie [Was: regular expressions that match nothing] |
Date: |
Thu, 16 May 2019 11:29:24 +0200 |
16 maj 2019 kl. 08.57 skrev phs <address@hidden>:
>
> 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.
Actually this one is documented:
For historical compatibility, special characters are treated as ordinary
ones if they are in contexts where their special meanings make no sense.
For example, `*foo' treats `*' as ordinary since there is no preceding
expression on which the `*' can act.
and in any case the 'correct' behaviour would be to signal a syntax error, not
repeat the empty string.
> If this behavior is the expected one, then (rx (0+ "")) should not
> return "*".
Thanks for reporting it, and you are right, that's a (known) bug in rx.
- Re: regular expressions that match nothing, (continued)
- 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, 2019/05/16
- Re: More re odditie [Was: regular expressions that match nothing],
Mattias Engdegård <=
- 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
- Re: Bootstrap/autoload policy (was Re: regular expressions that match nothing), Mattias Engdegård, 2019/05/22