1.1 --- a/moinformat/parsers/common.py Mon Jul 16 00:04:23 2018 +0200
1.2 +++ b/moinformat/parsers/common.py Mon Jul 16 00:08:09 2018 +0200
1.3 @@ -191,10 +191,12 @@
1.4
1.5 "Filter groups from the current match for the matching pattern."
1.6
1.7 + prefix = "%s_" % self.matching
1.8 +
1.9 d = {}
1.10 for key, value in self.match.groupdict().items():
1.11 - if key.startswith("%s_" % self.matching):
1.12 - d[key] = value
1.13 + if key.startswith(prefix):
1.14 + d[key[len(prefix):]] = value
1.15 return d
1.16
1.17 def match_group(self, group=None):
1.18 @@ -211,7 +213,7 @@
1.19 if group is None:
1.20 return self.s[self.start:self.end]
1.21 else:
1.22 - return self.groups.get("%s_%s" % (self.matching, group))
1.23 + return self.groups.get(group)
1.24 else:
1.25 return None
1.26
1.27 @@ -227,7 +229,7 @@
1.28 else:
1.29 l = []
1.30 for group in groups:
1.31 - l.append(self.groups.get("%s_%s" % (self.matching, group)))
1.32 + l.append(self.groups.get(group))
1.33 return l
1.34 else:
1.35 return []