in reply to Re: A rare, insidious logfile parsing pitfall
in thread A rare, insidious logfile parsing pitfall

Inside a character class, you don't need to escape '['. Your class above can legally be written as [^[]. You do need to escape ']' inside a character class, however, otherwise it will be interpreted as the closing bracket of your class. So, [^a]] means "any character other than 'a' followed by a ']'."

Its the exact opposite elsewere in the regex where an unescaped ']' is literal but '[' is not. To avoid mistakes, I usually escape both of them to get their literal interpretation no matter what their context.

Just a clarification, not necessarily a correction.

-Blake