def _combined_regex(regexes, flags=re.IGNORECASE, use_re2=False, max_mem=None):
 joined_regexes = '|'.join((r for r in regexes if r))
 if (not joined_regexes):
  return None
 if use_re2:
  import re2
  return re2.compile(joined_regexes, flags=flags, max_mem=max_mem)
 return re.compile(joined_regexes, flags=flags)

def _combined_regex ( regexes , flags = re . IGNORECASE , use_re2 = False , max_mem = None ) : joined_regexes = '|' . join ( ( r for r in regexes if r ) ) if ( not joined_regexes ) : return None if use_re2 : import re2 return re2 . compile ( joined_regexes , flags = flags , max_mem = max_mem ) return re . compile ( joined_regexes , flags = flags )
return a compiled regex combined from a list of regexes .