regex scanner groups findall tuple bug fixed
This commit is contained in:
12
wikiq
12
wikiq
@@ -189,7 +189,17 @@ class RegexPair(object):
|
||||
#given that there are matches to be made
|
||||
if self.pattern.search(content) is not None:
|
||||
m = self.pattern.findall(content)
|
||||
temp_dict[self.label] = ', '.join(m)
|
||||
m_fixed = []
|
||||
for match in m:
|
||||
if type(match) is tuple:
|
||||
matchies = set()
|
||||
for sub_m in match:
|
||||
matchies.add(sub_m)
|
||||
m_fixed += matchies
|
||||
else:
|
||||
m_fixed.append(match)
|
||||
|
||||
temp_dict[self.label] = ', '.join(m_fixed)
|
||||
else:
|
||||
temp_dict[self.label] = None
|
||||
|
||||
|
||||
Reference in New Issue
Block a user