In .NET (which support recursive regexes), you can use
Regex regexObj = new Regex(
@"\w+\s+ # Match identifier
\{ # Match {
(?> # Then either match (possessively):
(?: # the following group which matches
(?![{}]) # only if we're not before a { or }
. # any character
)+ # once or more
| # or
\{ (?<Depth>) # { (and increase the braces counter)
| # or
\} (?<-Depth>) # } (and decrease the braces counter).
)* # Repeat as needed.
(?(Depth)(?!)) # Assert that the braces counter is at zero.
\} # Then match }.",
RegexOptions.IgnorePatternWhitespace | RegexOptions.Singleline);