Extracting contents of a string within parentheses
<p>I have the following string: </p>

<pre><code>string = "Will Ferrell (Nick Halsey), Rebecca Hall (Samantha), Michael Pena (Frank Garcia)"
</code></pre>

<p>I would like to create a list of tuples in the form of <code>[(actor_name, character_name),...]</code> like so:</p>

<pre><code>[(Will Ferrell, Nick Halsey), (Rebecca Hall, Samantha), (Michael Pena, Frank Garcia)]
</code></pre>

<p>I am currently using a hack-ish way to do this, by splitting by the <code>(</code> mark and then using .rstrip('('), like so:</p>

<pre><code>for item in string.split(','):
    item.rstrip(')').split('(')
</code></pre>

<p>Is there a better, more robust way to do this? Thank you.</p>
