Optimisation of regexps in Perl?

From: Fredrik Ramsberg (f.r_at_mail.com)
Date: 10/14/03


Date: 14 Oct 2003 02:31:16 -0700

When searching for a specific sequence of charcters, like ($text =~ /monkeybreath/),
how efficient is Perl compared to other algorithms specifically developed for this
purpose? Does Perl recognise that it can use its index() functionality to search?

And how efficient are index() and rindex() compared to the best text search
algorithms?

Regards,

/Fredrik



Relevant Pages

  • Re: Way for computing random primes in standard C.
    ... There are a number of algorithms for finding primes, but, ... Make them all odd by adding one. ... Does it mean that further calls to rand() will return numbers with a new ... The algorithm which generates a semi-random or pseudo-random number sequence ...
    (comp.lang.c)
  • Re: Finding all occurrences of a subsequence
    ... Is it straight forward to get the locations of match from LCS ... algorithms for finding all occurrences ... of a sequence A in another sequence B, ... I guess it would be most straightforward to feed your pattern ...
    (comp.programming)
  • Re: The Pitman CSI Formula
    ... yet is capable of producing a string of infinite size. ... match of a sequence in question to any such algorithmically produced ... relatively simple algorithms repeated over and over again. ... to compute individual hex digits of pi without computing the ...
    (talk.origins)
  • Re: Fastcode Sort benchmark design
    ... Avatar Zondertau wrote: ... > I think we should not add worst cases for specific algorithms on ... > purpose. ... IMO benchmarks should be usage-oriented, ...
    (borland.public.delphi.language.basm)
  • Re: Good algorithm for Inverse of cumulative Students t?
    ... I'm trying to set up a credit risk model that employees a Student t ... copula. ... For this purpose, I need algorithms for: ...
    (sci.stat.math)