in reply to Re^2: Pimp My RegEx
in thread Pimp My RegEx
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
while in reality there are 11 entries:Parsed 10 log file entries in 0.0013 seconds, averaging 0.0001
% 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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Pimp My RegEx
by heathen (Acolyte) on May 31, 2005 at 20:19 UTC |