I\'m no expert on Regex. I\'m trying to create a regular expression that will match the exact same number of opening and closing braces, but I\'m stumped on how to do it.
This problem cannot be solved using regular grammar => it cannot be done by regular expression.
However - from Dirk Vollmar's comment - certain regex engines have extended functionality, e.g. the .NET one, which is capable of matching brackets using so called "balanced group definitions".