[FEEDBACK] Is this script efficient...is there a better way?

Steve Holden sholden at holdenweb.com
Tue Sep 17 14:51:44 EDT 2002


"Bob X" <bobx at linuxmail.org> wrote in message
news:fqrh9.7075$Lg2.1331983 at news2.news.adelphia.net...
> Steve Holden wrote:
> <snip>
>
> I did a test on the 30MB sized logs and the RE did indeed come out the
> faster, thought not by much. The interesting thing is it caught more as
> well since my script looked for exact matches and the RE based one
> ignored case (as far as my feeble brain understands such things).
>
> I remember why I had the "result" statement. It was because I needed to
> write the keyword found and then the line it was found on to the hits
file.
>
> Can't seem to make that work with the RE based one. Then again...I know
> RE as far as the east is from the west.
>
If the match succeeds it returns a match object. The match object has
methods that will retrieve the matched substring.

regards
-----------------------------------------------------------------------
Steve Holden                                  http://www.holdenweb.com/
Python Web Programming                 http://pydish.holdenweb.com/pwp/
Previous .sig file retired to                    www.homeforoldsigs.com
-----------------------------------------------------------------------
>






More information about the Python-list mailing list