Okay simple problem, not sure how to handle it. The idea is similar to how some other bots are doing this, in this instance, DeepBot. I'm trying to simulate the ability to do @command@[value] but with the ability to handle nested commands. For example, I created a @lower@[] command and there is also the ability to do @target@[1] (where it returns only the first token of text from anything extra typed). So, @lower@[@target@[1]] should return the first token of text but in lowercase. The idea is simple enough, handle the inner most []'s first and work outward, but the problem is, how do I go about doing that?

I know that I could have it parse @target@'s first, but that addresses a symptom and not the problem, because it could be something else that needs to be parsed first or could be flip-flop order, etc.

I'm sure that regex is necessary to do this and I'm using that already to find the use of @commands@, but the way it's crapping out on me is if I have @command@[@othercommand@[value]] because the second ']' is chopped off. Can't exactly have it grab until the last ] because that'll cause problems too.

Any ideas?