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

In fact, with the example you supplied, the output is

Parsed 10 log file entries in 0.0013 seconds, averaging 0.0001
while in reality there are 11 entries:
% perl -lne 'print substr($_, 0, 30) if /^2004/' 462148.pl 2004-01-05 22:37:48:879 : xscW 2004-01-05 22:38:52:019 : xscW 2004-01-05 22:43:02:239 : xscW 2004-02-05 22:37:48:879 : xscW 2004-02-05 22:38:52:019 : xscW 2004-02-05 22:43:02:239 : xscW 2004-02-05 22:43:50:769 : xscW 2004-02-05 22:44:51:979 : xscW 2004-02-05 22:47:12:879 : xscW 2004-02-05 22:49:50:059 : xscW 2004-02-05 22:49:50:079 : xscW % perl -lne 'print substr($_, 0, 30) if /^2004/' 462148.pl | wc 11 44 341

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


In reply to Re^3: Pimp My RegEx by tlm
in thread Pimp My RegEx by heathen

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.