Question: I'm trying to construct a regex that will match nested braces but not match single braces.

For example given this string: 

```
" { { I'm so cool, I'm nested  } } I'm neither { I'm just boring normal braces } "

```

The regex should match:

```
{ { I'm so cool, I'm nested  } }

```

But not:

```
{ I'm just boring normal braces }

```

I think I'm almost there, I been playing around on regex tester to try and make it work, however I must be missing something.

This is what I got so far:

```
(?(?=\{(?>[^\{\}]++|(?R))*\})(\{(?>[^\{\}]++|(?R))*\}))

```

It still matches singles though.

The idea is that it uses an if statement with a positive lookahead to check whether there are nested braces. If there are it matches them. I can't figure out how to exclude regular ones though.

Answer: 
You can group it and get match at index 1.

```
({\s*{+.*?}+\s*})

```

Here is demo on [regex101](http://regex101.com/r/lI3pV9)
This should work for exactly 2nd level nested curlies:

```
{[^{}]*{([^}]*)}

```