Python正则表达式匹配元组对

kar*_*waj 2 regex python-2.7

寻找正则表达式以匹配列表中的元组对.一直使用下面的正则表达式

s = '[(aleakedteaserand, NN), (abehind, IN), (the, DT)]'    
re.findall(r'\((.*,.*)\)',s)
Run Code Online (Sandbox Code Playgroud)

但它仍然缺少最终的支撑.

['aleakedteaserand, NN), (abehind, IN), (the, DT']
Run Code Online (Sandbox Code Playgroud)

预期产量:

[(aleakedteaserand,NN),(abehind,IN),(the,DT)]

csa*_*nho 8

你没有让RegEx不合适.解决方案是re.findall(r'\((.*?,.*?)\)',s).