in reply to Re: Pimp My RegEx
in thread Pimp My RegEx

For the sake of brevity, I cut out my "payload" and just counted lines. I counted lines just to benchmark the regex times. My rationale was something like this: "find a line that starts with a date, capture all of the text (including new lines) until I can lookahead and find another date."

Replies are listed 'Best First'.
Re^3: Pimp My RegEx
by tlm (Prior) on May 31, 2005 at 18:57 UTC

    Yes, but as originally written your regex would miss the last log entry, because it fails the positive lookahead assertion.

    Regarding the payload, please see the update to my original reply.

    Update: Added further comments on the error in the original regex.

    the lowliest monk

      as originally written your regex would miss the last log entry, because it fails the positive lookahead assertion

      You are correct - definately an unintended consequence. Since a log file entry could span multiple lines I was using the lookahead to in effect say "stop capturing when you can see the next log file entry"
      The sample data I included in the original script probably should have included some of the more complex, multi-line log file entries.