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

Method finditer

rure/regex.py:118–125  ·  view source on GitHub ↗
(self, string, pos=0, endpos=None)

Source from the content-addressed store, hash-verified

116
117 @accepts_string
118 def finditer(self, string, pos=0, endpos=None):
119 haystack = string[:endpos].encode('utf8')
120 if self.submatches:
121 for captures in self._rure.captures_iter(haystack, pos):
122 yield MatchObject(pos, endpos, self, haystack, captures)
123 else:
124 for i, match in enumerate(self._rure.find_iter(haystack, pos)):
125 yield MatchObject(pos, endpos, self, haystack, i)
126
127 @accepts_string
128 def sub(self, repl, string, count=0):

Callers 3

findallMethod · 0.95
finditerFunction · 0.80
test_finditerMethod · 0.80

Calls 3

MatchObjectClass · 0.85
captures_iterMethod · 0.45
find_iterMethod · 0.45

Tested by 1

test_finditerMethod · 0.64