Re: Regular expressions, PCRE [was: Relation(s) between/among Kate, Kwrite, and Katepart]
On Mon, Apr 21, 2025 at 06:55 <tomas@tuxteam.de> wrote:
> On Mon, Apr 21, 2025 at 07:34:13AM -0400, Greg Wooledge wrote:
> > On Mon, Apr 21, 2025 at 08:04:44 +0200, tomas@tuxteam.de wrote:
> > > [...] quite possibly Perl's engine has been refined (it definitely has
> > > been extended) since then.
>
> [...]
>
> > It still has the issue.
> >
> > hobbit:~$ time perl -e '$s = "a" x 25; $r = "a?" x 25 . "a" x 25; if ($s =~ $r) { print "yes\n"; }'
> > yes
> > real 1.354 user 1.349 sys 0.004
On my box I for that example using Perl l get:
> real 0.742 user 0.738 sys 0.004
If you install Raku (formerly Perl 6) you can try for comparison:
$ sudo aptitude install raku
Note Raku has some slightly different syntax for the same example:
$ time raku -e ‘my $s = “a” x 25; my $r = “a?” x 25 ~ “a” x 25; if
($s ~= $r) { say “yes” } ‘
Raku’s regular expression grammar is much better than Perl’s. Larry
was very picky about that.
Running the Raku one-liner on my box, I get:
> real 0.138 user 0.129 sys 0.004 # Rake v 2025.03
> real 0.742 user 0.738 sys 0.004 # Perl v5.32.1
Your Raku version on Debian is probably not the latest, but you should
see results better than Perl’s.
Best to all,
-Tom
-Tom
Reply to:
- References:
- Relation(s) between/among Kate, Kwrite, and Katepart
- From: Richard Owlett <rowlett@access.net>
- Re: Relation(s) between/among Kate, Kwrite, and Katepart
- Re: Relation(s) between/among Kate, Kwrite, and Katepart
- From: Richard Owlett <rowlett@access.net>
- Re: Relation(s) between/among Kate, Kwrite, and Katepart
- Re: Relation(s) between/among Kate, Kwrite, and Katepart
- From: debian-user@howorth.org.uk
- Re: Relation(s) between/among Kate, Kwrite, and Katepart
- Re: Relation(s) between/among Kate, Kwrite, and Katepart
- From: David <bouncingcats@gmail.com>
- Regular expressions, PCRE [was: Relation(s) between/among Kate, Kwrite, and Katepart]
- Re: Regular expressions, PCRE [was: Relation(s) between/among Kate, Kwrite, and Katepart]
- From: Greg Wooledge <greg@wooledge.org>
- Re: Regular expressions, PCRE [was: Relation(s) between/among Kate, Kwrite, and Katepart]
- Prev by Date:
Re: Relation(s) between/among Kate, Kwrite, and Katepart
- Next by Date:
Re: Regular expressions, PCRE [was: Relation(s) between/among Kate, Kwrite, and Katepart]
- Previous by thread:
Re: Regular expressions, PCRE [was: Relation(s) between/among Kate, Kwrite, and Katepart]
- Next by thread:
Re: Regular expressions, PCRE [was: Relation(s) between/among Kate, Kwrite, and Katepart]
- Index(es):