':param re_list: A list with all the regular expressions that we want
to match against one or more strings using the "query" function.
This list might be [re_str_1, re_str_2 ... , re_str_N] or something like
[ (re_str_1, obj1) , (re_str_2, obj2) ... , (re_str_N, objN)]. In the first
case, if a match is found this class will return [ (match_obj, re_str_N, pattern_obj), ]
in the second case we\'ll return [ (match_obj, re_str_N, pattern_obj, objN), ]'

def __init__(self, re_list, re_compile_flags=0, hint_len=3):

    self._index = LongKeywordIndex(hint_len=hint_len)
    self._re_cache = {}
    for item in re_list:
        if isinstance(item, tuple):
            regex = item[0]
            regex = regex.encode(DEFAULT_ENCODING)
            self._re_cache[regex] = re.compile(regex, re_compile_flags)
            self._index.enter(regex, item)
        elif isinstance(item, basestring):
            item = item.encode(DEFAULT_ENCODING)
            self._re_cache[item] = re.compile(item, re_compile_flags)
            self._index.enter(item, (item,))
        else:
            msg = 'Can    NOT    build    esmre_multire    with    provided    values.'
            raise ValueError(msg)
