MCPcopy Create free account
hub / github.com/davidblewett/rure-python / lastgroup

Method lastgroup

rure/regex.py:175–185  ·  view source on GitHub ↗
(self, decode=True)

Source from the content-addressed store, hash-verified

173
174 @property
175 def lastgroup(self, decode=True):
176 groups = [
177 gname
178 for gindex, gname in enumerate(self.re.capture_names())
179 if gname is not None and self.captures[gindex] is not None
180 ]
181 if groups:
182 if decode:
183 return groups[-1].decode('utf8')
184 else:
185 return groups[-1]
186
187 @property
188 def captures(self):

Callers

nothing calls this directly

Calls 1

capture_namesMethod · 0.45

Tested by

no test coverage detected