Beispiel #1
0
    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)
Beispiel #2
0
 def findall(self, string, pos=0, endpos=-1):
     return list(Regexp.findstrings(self, string, pos, endpos))
Beispiel #3
0
 def finditer(self, string, pos=0, endpos=-1):
     for match in Regexp.find(self, string, pos, endpos):
         yield SRE_Match(match)
Beispiel #4
0
 def split(self, string, maxsplit=0, pos=0, endpos=-1):
     return Regexp.split(self, string, maxsplit, pos, endpos, True)
Beispiel #5
0
 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)
Beispiel #6
0
 def search(self, string, pos=0, endpos=-1):
     rv = Regexp.search(self, string, pos, endpos)
     if rv is not None:
         return SRE_Match(rv)
Beispiel #7
0
 def findall(self, string, pos=0, endpos=-1):
     return list(Regexp.findstrings(self, string, pos, endpos))
Beispiel #8
0
 def finditer(self, string, pos=0, endpos=-1):
     for match in Regexp.find(self, string, pos, endpos):
         yield SRE_Match(match)
Beispiel #9
0
 def split(self, string, maxsplit=0, pos=0, endpos=-1):
     return Regexp.split(self, string, maxsplit, pos, endpos, True)
Beispiel #10
0
 def search(self, string, pos=0, endpos=-1):
     rv = Regexp.search(self, string, pos, endpos)
     if rv is not None:
         return SRE_Match(rv)