def subn(self, repl, string, count=0, pos=0, endpos=-1): if callable(repl): def repl(m, r=repl): return r(SRE_Match(m)) return Regexp.subn(self, repl, string, count, pos, endpos)
def findall(self, string, pos=0, endpos=-1): return list(Regexp.findstrings(self, string, pos, endpos))
def finditer(self, string, pos=0, endpos=-1): for match in Regexp.find(self, string, pos, endpos): yield SRE_Match(match)
def split(self, string, maxsplit=0, pos=0, endpos=-1): return Regexp.split(self, string, maxsplit, pos, endpos, True)
def search(self, string, pos=0, endpos=-1): rv = Regexp.search(self, string, pos, endpos) if rv is not None: return SRE_Match(rv)