Add one-versus-many-matches logic to network filter plugin (#30511)
* Add one-versus-many-matches logic
* Fixed indentation (tabs ==> spaces)
(cherry picked from commit 9aa1da23f0
)
This commit is contained in:
parent
042079aa87
commit
0d61acc730
1 changed files with 4 additions and 1 deletions
|
@ -56,7 +56,10 @@ def re_matchall(regex, value):
|
|||
obj = {}
|
||||
if regex.groupindex:
|
||||
for name, index in iteritems(regex.groupindex):
|
||||
obj[name] = match[index - 1]
|
||||
if len(regex.groupindex) == 1:
|
||||
obj[name] = match
|
||||
else:
|
||||
obj[name] = match[index - 1]
|
||||
objects.append(obj)
|
||||
return objects
|
||||
|
||||
|
|
Loading…
Reference in a new issue