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

Method search

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

Source from the content-addressed store, hash-verified

74
75 @accepts_string
76 def search(self, string, pos=0, endpos=None):
77 haystack = string[:endpos].encode('utf8')
78 if self.submatches:
79 captures = self._rure.captures(haystack, pos)
80 if captures:
81 return MatchObject(pos, endpos, self, haystack, captures)
82 else:
83 match = self._rure.find(haystack, pos)
84 if match:
85 return MatchObject(pos, endpos, self, haystack, 0)
86
87 @accepts_string
88 def match(self, string, pos=0, endpos=None):

Callers 5

searchFunction · 0.80
test_match_is_booleanMethod · 0.80
test_start_endMethod · 0.80
test_searchMethod · 0.80

Calls 3

MatchObjectClass · 0.85
capturesMethod · 0.45
findMethod · 0.45

Tested by 4

test_match_is_booleanMethod · 0.64
test_start_endMethod · 0.64
test_searchMethod · 0.64