Need to cut out all characters in between 2 brackets in a string
<p>I have a string in python 2.7:</p>

<pre><code>a = 'This is some text ( - 1) - And some more text (0:0) - Some more Text'
</code></pre>

<p>I would like to use a regex to get the ' - 1' out of this string. </p>

<p>I've tried but can't find it, thanks for your help, I've tried: </p>

<pre><code>re.search(r'.*?\((.*)\).*', a)
</code></pre>

<p>But that didn't work. Mind you there's a second ( ) in the string but I only need the first one. </p>

<p>THANK YOU!</p>

<p>This would do it:</p>

<pre><code>out = re.match('.*?\((.*?)\)', a).groups()[0]
</code></pre>

<p>if you wanted to remove from the original string,</p>

<pre><code>a.replace(out, '')
</code></pre>

python regex