in reply to Re: Re: Regular Expression
in thread Regex on log file hangs

It did work just like the first code I have. If I am using a small file it goes fast, but if I am parsing a text log file with 100.000 lines it hangs again!

Replies are listed 'Best First'.
Re: Re: Re: Re: Regular Expression
by Shendal (Hermit) on Aug 13, 2002 at 17:58 UTC
    In my test, I am completing 100k lines worth of substitution in approximately 4 seconds. Your mileage may vary.

    Can you give an example of the source you are parsing? Perhaps you can anchor your substitutions somewhere? Perhaps the code is "hanging" else where (i.e., have you tried print statements before and after this section to verify that it is where the "hanging" is occuring?)? How long does the program "hang"? Is it consuming CPU while it is "hung"?

    Cheers,
    Shendal