in reply to Help Creating a Code Filter

I think you want to use a grammar, not ad-hoc string processing. That way only lies madness.