Andrew Pimlott <[EMAIL PROTECTED]> wrote:
> On Thu, Feb 14, 2002 at 10:20:50PM -0500, Jeff 'japhy' Pinyan
> wrote:
> > while ($str =~ m{ ([^\0]{$len,}) (?= [^\0]* \0 [^\0]*? \1 ) }xg) {
>
> Thanks to the comma, ^
>
> > $len = length($match = $1) + 1;
> > }
>
> this is O(N^3) in the case of no common substring:
I don't think the /g is necessary either, unless there's a
requirement to find the last substring if there's more than one
of the same length. And without the /g there's no need to make
the last part of the match a lookahead.
--
Keith C. Ivey <[EMAIL PROTECTED]>
Washington, DC