提取单引号之间的子字符串 - python

我是python的新手,正在尝试提取单引号之间的子字符串。您知道如何使用正则表达式执行此操作吗?

E.G输入

 text = "[(u'apple',), (u'banana',)]"

我想提取苹果和香蕉作为列表项,例如['apple', 'banana']

python大神给出的解决方案

text = "[(u'apple',), (u'banana',)]"   

print(re.findall(r"\(u'(.*?)',\)", text)
['apple', 'banana']

text = "[(u'this string contains\' an escaped quote mark and\\ an escaped slash',)]"
print(re.findall(r"\(u'(.*?)',\)", text)[0])
this string contains' an escaped quote mark and \ an escaped slash