in reply to pattern matching

be really careful here in making sure your data sample is an accurate worst-case example. for instance, if there are nested if structures in your real data, how do you handle that?

i haven't checked any code, but it seems possible these methods may fail in that case, and that you'd have to build a more robust algorithm. i can't check your data, but i've been bitten by something like this in the past. my own experience with this compels me to tell you: be careful.

TEST, TEST, TEST!!!

~Particle