[Israel.pm] run many regexes

Yossi Itzkovich Yossi.Itzkovich at ecitele.com
Thu May 1 18:52:11 EEST 2008


 I guess that if there are many regexes that work on the same part of the text - it's may be better to hold that part in a separate string and work on it.
Using anchors should help too.

Yossi

-----Original Message-----
From: perl-bounces at perl.org.il [mailto:perl-bounces at perl.org.il] On Behalf Of Gaal Yahas
Sent: Thursday, May 01, 2008 6:49 PM
To: Perl in Israel
Subject: Re: [Israel.pm] run many regexes

Do you need sophisticated captures, or is there always the same amount
of positionals (or do you just need to know whether you matched or
not)?

Make sure you're using 5.10. Alternatively, try Regexp::Optimizer.

Precompile your regexps with qr// and store the results in a wide
enough scope that you don't recompute them.


On Thu, May 1, 2008 at 3:13 PM, Pinkhas Nisanov <pinkhas at nisanov.com> wrote:
> Hi,
>
>  I need run many ( hundreds ) regexes on some string.
>  Is there some way to optimize it and get better performance?
>
>  thanks
>  Pinkhas Nisanov
>  _______________________________________________
>  Perl mailing list
>  Perl at perl.org.il
>  http://perl.org.il/mailman/listinfo/perl
>



--
Gaal Yahas <gaal at forum2.org>
http://gaal.livejournal.com/
_______________________________________________
Perl mailing list
Perl at perl.org.il
http://perl.org.il/mailman/listinfo/perl


More information about the Perl mailing list