[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: More re odditie [Was: regular expressions that match nothing]
From: |
Stefan Monnier |
Subject: |
Re: More re odditie [Was: regular expressions that match nothing] |
Date: |
Thu, 16 May 2019 08:31:20 -0400 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) |
> I'd rather read `*' as meaning "repeat the empty string",
`*` repeats the immediately preceding regular expression, but here there
is no preceding regular expression:
- there are various ways to resolve this problem.
- all "reasonable" semantics are pretty useless in the sense that it's
trivial to write another regexp with the same semantics.
- the combination of the previous two points implies that signaling an
error is probably the better option.
> BTW, can your scans of regexps tell if this compatibility is relied on a
> lot?
His scan does catch those (and many other of its friends).
> It would be safe to replace `*' and `+' with `\*' and `\+' where
> this happens.
We've done that, indeed.
> I've just grep'ed quickly through the code and only noticed a risky
> use of "+" (and "[..]") in the definition of `term-word' in term.el
That's because we already fixed the occurrences that his tool finds ;-)
>> Thanks for reporting it, and you are right, that's a (known) bug in rx.
> When rx is fixed, I suggest we add the following extra tests (see patch)
Good idea.
Stefan
- Re: regular expressions that match nothing, (continued)
- 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, 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 <=
- 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
- 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