def multi_match(*l): l = filter(filter_regexps, l) if ('.' in l): myre = '.' else: myre = '^\s*(?:%s)' % ('|'.join(map(lambda x:'(?:%s)' % (libmisc.space_to_respace(x)), l))) return myre
def multi_match(*l): l = filter(filter_regexps, l) if ('.' in l): myre = '.' else: myre = '^\s*(?:%s)' % ('|'.join( map(lambda x: '(?:%s)' % (libmisc.space_to_respace(x)), l))) return myre
def compile_multi_match(*l): l = filter(filter_regexps, l) if ('.' in l): l = ['.'] if (not l): return catcher.NullRE() # object that never matches anything if (len(l) == 1): return re.compile(l[0]) else: myre = '^\s*(?:%s)' % ('|'.join(map(lambda x:'(?:%s)' % (libmisc.space_to_respace(x)), l))) return re.compile(myre)
def compile_multi_match(*l): l = filter(filter_regexps, l) if ('.' in l): l = ['.'] if (not l): return catcher.NullRE() # object that never matches anything if (len(l) == 1): return re.compile(l[0]) else: myre = '^\s*(?:%s)' % ('|'.join( map(lambda x: '(?:%s)' % (libmisc.space_to_respace(x)), l))) return re.compile(myre)
def compile_re(regexp, flags = re.MULTILINE|re.DOTALL): regexp = libmisc.space_to_respace(regexp) return re.compile(regexp, flags)
def compile_re(regexp, flags=re.MULTILINE | re.DOTALL): regexp = libmisc.space_to_respace(regexp) return re.compile(regexp, flags)