emacs-devel
[Top][All Lists]
Advanced

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

Re: Regular expression libraries


From: Clément Pit--Claudel
Subject: Re: Regular expression libraries
Date: Fri, 16 Dec 2016 09:31:08 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1

On 2016-12-16 02:20, Paul Eggert wrote:
> Andreas Schwab wrote:
>>> Another library is in that list:
>>> 
>>> - The GNU C library, which ordinarily uses a DFA but which uses 
>>> backtracking if needed.
>> But it doesn't support a gap.
> 
> True, but none of the others do either. Only the old glibc code
> (which survives only in Emacs now) does that, as far as I know.

TRE does.

> I doubt whether it'd be that hard to add gap support to any regexp
> matcher, as it's simply interposing an address calculation.

I did ask both the Oniguruma and the RE2 people; neither were optimistic 
(admittedly, my question was about supporting a slightly more general form than 
2 chunks).  In RE2, there are optimizations like using memchr to find the next 
character within a memory region, which are tricky to use if address 
calculations are added into the mix.

Clément.

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

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