Get Firefox! "my blog doesn't just deal with my life, it deals with some important stuff too"

30th of November 2004

Perl Regular Expressions

You gotta love it. Just when you think you know everything you really need to know about Regular Expressions, something goes tits-up and you spend a day trying to work out why. Then when you do you learn something new. Then something else goes tits-up and you realise your regular expression is running extremely inefficiently. So you go to fix it, and realise you need to learn something new. So you learn it and then realise that you will, in fact, need to learn something ELSE new. So you start trying to learn it and realise it is, in fact, completely mental. I am referring to inserting Perl statements into Regular Expressions.

So what you end up with is some Perl, then a block of Regular Epression, with some Perl in the middle of it, a bit more Regular Expression and then Perl. This might sound easy at first, but then one realises that one has to build the regexp in a certain way to force the Perl in the middle of it to be executed. And then one realises that the Perl behaves arbitrarily different depending on what the regular expression does, what the perl does, what context the perl is in, and where the moon lies in relation to the earth and the sun.

Wish me luck, I'm going in.

Blog #381, posted at 20:25 (GMT)