in reply to Pure Ftpd log regex
Try this. I've assumed that you just wrapped the two lines for posting.
It's simpler and commented, which usually makes it more efficient and readable. Though the former is a matter of trial more than know-how and the latter is in the eye of the beholder.
my $re = qr| ( \S+ ) \s # Month $1 ( \S+ ) \s # Day $2 ( \S+ ) [^\(]+ # Time $3 \( ( [^@]+ ) # User $4 @ ( [^\)]+ ) # IP $5 \) [^/]+ ( .* )\sdownloaded\s\( # File $6 ( \d+ ) \D+ # Size $7 ( [^\)]+ ) # Speed $8 |x;
|
|---|