It may seem like overkill for this problem but learning regular expressions will make string processing problems like this a lot easier. And almost all serious programming languages today have a regular expression library very much like perl's, so chances are high you'd be able to use that knowledge if you're using some other language too.
In reply to Re^3: group things?
by Joost
in thread group things?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |