develooper Front page | perl.perl5.porters | Postings from June 2021

Re: Benchmarking Pure Perl Trim Functions.

Thread Previous | Thread Next
June 4, 2021 13:30
Re: Benchmarking Pure Perl Trim Functions.
Message ID:
On Fri, 4 Jun 2021 at 03:06, <> wrote:

> Nicholas Clark <> wrote:
> :More - I assumed that the regexes used to "trim spaces from the right" are
> :
> :1) simple to recognise
> :2) there aren't that many variations of them
> :
> :So I set off with the goal of recognising them in the regex compiler, and
> :then having re_intuit_start() implement them better.
> :
> :In the branch

Nicholas: Very Interesting. Similar to the stuff  i did with split. I like.
But I think i missed support for:


etc. FWIW I am not sure how sane this approach is for THIS problem but its
worth seeing how far you can take it, and I definitely think it could work.

BTW, Hugo: the trie code is totally capable of building a machine  that we
could use to match /foo\z/ *from the right*, if we wished to do so.
Constructing a DFA to match from the right is pretty much the same as
constructing a DFA from the left, and the trie code just implements a
non-cyclic DFA.

I generate such a machine in the perl code in

That perl code is a baby version of what  the trie code does in C in the
regex engine.


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About