[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: |
Tue, 14 May 2019 12:14:52 +0200 |
User-agent: |
Evolution 3.30.5 (3.30.5-1.fc29) |
tis 2019-05-14 klockan 09:25 +0200 skrev philippe schnoebelen:
> I was wondering why (regexp-opt nil) uses a\` and not \'a or another
> option like \=a\= so I did some profiling (see attached code).
Thank you, and sorry about my bad initial attempt. I tried a few more,
like [z-a], \c* and \sq, but these were no better. The distribution is
decidedly bimodal; there seems to be no significant difference between
the 'fast' ones, so I went with \`a\` in the attached patch.
> Of course this may be dependent on the internals of the specific
> regexp library at hand. I do not know enough to judge. In fact I
> believe that a solid regular expression library should provide a
> specific regular expression that matches nothing with special but
> easy treatment that guarantees best response time.
We could add a standard constant for it, like unmatchable-regexp, so
that at least people don't keep reinventing it.
We could also make (rx (or)) work. (It does in my complete rx rewrite.)
0001-Use-faster-unmatchable-regexp.patch
Description: Text Data
- regular expressions that match nothing, philippe schnoebelen, 2019/05/14
- Re: regular expressions that match nothing,
Mattias Engdegård <=
- Re: regular expressions that match nothing, Stefan Monnier, 2019/05/14
- Re: regular expressions that match nothing, Mattias Engdegård, 2019/05/15
- 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