Regex matching a C++ class
<p>I need to match all the C++ classes in a header file using python, each with its whole content.
I have tried a few combination (wild guesses) but didn't work, like this one:</p>

<pre><code>'class\s+([a-zA-Z0-9_]+)\s*{([^{}]*)}\s*([a-zA-Z0-9_]+)\s*;'
</code></pre>

<p>Consider that the class might include extending part, and it may contain also inner class.</p>