我想在括号之间提取值。让我们说我有,代码如下:
string = "Will Ferrell (Nick Halsey), Rebecca Hall (Samantha), Michael Pena (Frank Garcia)"
pat = re.findall(r'\((.*)\)', string)
它返回:
[u'Nick Halsey), Rebecca Hall (Samantha), Michael Pena (Frank Garcia']
但是,我想要:
[u'Nick Halsey, Samantha, Frank Garcia']
有关如何操作的任何想法?