예제 #1
0
 def set_source(self, space, source, flags):
     if source is not None:
         cache = space.fromcache(RegexpCache)
         self.source = source
         code, flags, groupcount, groupindex, indexgroup, group_offsets = regexp.compile(cache, source, flags)
         self.code = code
         self.flags = flags
         self.groupcount = groupcount
         self.groupindex = groupindex
         self.indexgroup = indexgroup
         self.group_offsets = group_offsets
예제 #2
0
 def set_source(self, space, source, flags):
     if source is not None:
         cache = space.fromcache(RegexpCache)
         self.source = source
         code, flags, groupcount, groupindex, indexgroup, group_offsets = regexp.compile(cache, source, flags)
         self.code = code
         self.flags = flags
         self.groupcount = groupcount
         self.groupindex = groupindex
         self.indexgroup = indexgroup
         self.group_offsets = group_offsets
예제 #3
0
파일: glob.py 프로젝트: denim2x/Seraph
def regexp_match(cache, re, string):
    pos = 0
    endpos = len(string)
    code, flags, _, _, _, _ = regexp.compile(cache, re)
    return (rsre_core.StrMatchContext(string, pos, endpos,
                                      flags), rsre_core.CompiledPattern(code))
예제 #4
0
파일: glob.py 프로젝트: bitprophet/topaz
def regexp_match(cache, re, string):
    pos = 0
    endpos = len(string)
    code, flags, _, _, _, _ = regexp.compile(cache, re)
    return rsre_core.StrMatchContext(code, string, pos, endpos, flags)