'Apply the regular expressions to the target_str and return a list
according to the class __init__ documentation.
:param target_str: The target string where the regular expressions are
going to be applied. First we apply the esmre algorithm and then we do
some magic of our own.
See test_multire.py for examples.'

def query(self, target_str):

    result = []
    if isinstance(target_str, unicode):
        target_str = target_str.encode(DEFAULT_ENCODING)
    query_result_list = self._index.query(target_str)
    for query_result in query_result_list:
        matched_regex = query_result[0]
        regex_comp = self._re_cache[matched_regex]
        matchobj = regex_comp.search(target_str)
        if matchobj:
            resitem = [matchobj, matched_regex, regex_comp]
            resitem.extend(query_result[1:])
            result.append(resitem)
    return result
