如何从列表中的每个元组中提取中间字符?

时间:2019-06-16 19:58:12

标签: python python-3.x

我有以下列表:[[('a','b','c')],[('d','e','f')]],我想提取以下输出:['b','e']

我该怎么做?

r1 = [re.findall("(\d+\/\d+\/\d+)(,)(\s)(\d+:\d+)(\s)(\w+)(\s)(-)", x) for x in linebyline]

r2 = [re.findall("(\d+\/\d+\/\d+)(,)(\s)(\d+:\d+)(\s)(\w+)(\s)(-)(\s\w+)", x) for x in linebyline]

我想从r1中删除r2r1具有上面第一行中所述的形式。

0 个答案:

没有答案