bug-glibc
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: re_search does not find match


From: Stepan Kasal
Subject: Re: re_search does not find match
Date: Sun, 23 Feb 2003 09:16:05 +0100
User-agent: Mutt/1.2.5.1i

Hello,

        I've looked at the following bug-report:

On Tue, Feb 04, 2003 at 01:11:05AM -0500, Patrick Smith wrote:
>     char ptrn[] =
> "^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\\9\\8\\7\\6\\5\\4\\3\\2\\1$";
>     char stack[] = "civic";

when experimenting with shortened versions of the pattern, I came to a
conclusion that the regex (current CVS version) works correctly but is
extremely slow.  I wasn't patient enough to wait for the result.

The pattern

        ^(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\7\6\5\4\3\2\1$

works, but is somewhat slow.

Similarilly

        ^(.)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?\8\7\6\5\4\3\2\1$

works, even though takes some time.

Finally, pattern

        ^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.).?\9\8\7\6\5\4\3\2\1$

is really quick.

Is there any reason why the original patters is so evil?

Regards,
        Stepan Kasal




reply via email to

[Prev in Thread] Current Thread [Next in Thread]