It appears you are trying to find the string bounded by the outermost pair of square brackets and allowing nested square brackets within the string
Try the expression described in the following blog entry: http://blogs.msdn.com/bclteam/archive/2005/03/15/396452.aspx. The example uses angle brackets as the thing being matched, but you should be able to convert the expression to look for square brackets fairly easily.
Remember that you need to use \[ and \] to represent the actual '[' and ']' characters and be careful to distinguish between the angle brackets that are part of the expression being matched and the angle brackets that are part of the RegEx expression ( <name>subexpression).
|