寻找匹配列表中元组对的正则表达式。一直在使用下面的正则表达式
s = '[(aleakedteaserand, NN), (abehind, IN), (the, DT)]'
re.findall(r'\((.*,.*)\)',s)
但它仍然缺少结束括号。
['aleakedteaserand, NN), (abehind, IN), (the, DT']
期望的输出结果:
[(aleakedteaserand, NN), (abehind, IN), (the, DT)]