?

Log in

No account? Create an account
Fun with regexes! - Chronicles of a Hereditary Geek [entries|archive|friends|userinfo]
Darth Paradox

[ website | Pyrlogos - a fantasy webcomic ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

Fun with regexes! [Mar. 24th, 2006|05:07 pm]
Darth Paradox
[Tags|]
[mood |amusedamused]
[music |Simon and Garfunkel - The Boxer]

Specifically, fun with regexes processing other regexes. We've got a bunch of regexes for processing logs, and I needed to change their identical beginning strings to match the log format more precisely. So I figured sed was the right tool for the job.

And now, after assembling the sed command string... well, I still figure sed's the right tool for the job, but that doesn't mean I'm not amused.

s/\^\[\^\[\]\*\\\[/\^\\w\+\\s\+\\w\+\\s\+\\d\+\\s\+\\d\+:\\d\+:\\d\+\\s\+\[\^\[\]\*\\\[/


Ow, my head. But at least it works.

5:10 PM on Friday. So close....
linkReply

Comments:
[User Picture]From: unspeakablevorn
2006-03-25 01:14 am (UTC)
Ow, my head.

Vorn
(Reply) (Thread)
[User Picture]From: carn_carby
2006-03-25 01:19 am (UTC)
Even *your* head, Mr. Amazing Mathie? =]
(Reply) (Parent) (Thread)
[User Picture]From: unspeakablevorn
2006-03-25 01:22 am (UTC)
Even my head, and I was called the Bastard God of Regexp for a while. Until I abdicated the throne to TF, who has apparently written an IRC client almost entirely in regexp.

Vorn
(Reply) (Parent) (Thread)
[User Picture]From: carn_carby
2006-03-25 01:40 am (UTC)
TF is a very bright young lad like y'self! O_o And like Darth!
(Reply) (Parent) (Thread)
[User Picture]From: sertrel
2006-03-25 04:17 am (UTC)
You, sir, are the Metamucil of regular expressions.
(Reply) (Thread)