REGEX is not exactly my favorite technology to have to work with, but there are times when it is definitely the right tool for the job. Recently I needed to parse a large text file that contained blocks of information within curly brackets - {}. I found a great solution for the REGEX at: http://blog.stevenlevithan.... Note that balancing groups is only in the Microsoft REGEX classes... if you are using a different library you may have to follow an alternative, less powerful ......