寻找正则表达式以匹配列表中的元组对.一直使用下面的正则表达式
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)]