Hello,
Does anyone know of a good log parser for L4D? I'm mainly interested in
parsing the chat lines and stripping out everything except the date,
time, player name, and chat text. I started writing one in Perl, but I
soon realized that it's the player name can contain all kinds of
The code available from hlstats seems pretty decent at handling most
usernames. We've used it for our TF2 tourney scoreboard
(http://www.nomoose.org/?p=122
) without much hassle. It's all perl regex's that grab pretty much
everything you'd need. Worth a look and pretty easy to strip out
This should pick up what you want.
/^L (\d+?)\/(\d+?)\/(\d+?) - (\d+?):(\d+?):(\d+?): (.+?)(?:.+?)+
(?:say|say_team) (.+?).*$/
$month = $1;
$day = $2;
$year = $3;
$hour = $4;
$minute = $5;
$second = $6;
$playername = $7;
$message = $8;
David A. Parker wrote:
Hello,
Does anyone know of a good
Thanks Bruce and Nicholas. I can certainly hack something together from
these solutions. Nicholas, your regex is awesome. It's a lot better
than the way I was trying to do this using split(). :-)
- Dave
Nicholas Hastings wrote:
This should pick up what you want.
/^L
4 matches
Mail list logo