<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _get_regex_search(input_string, regex, metadata={}, match_index=None, ignore='', flags=0):
 """ Using this so that all results from the functions return similar results :param input_string: str, input string to be checked :param regex: str, input regex to be compiled and searched with :param match_index: (int, None), whether to get a specific match, if None returns all matches as list :param metadata: dict, dictionary of extra meta tags needed to identify information :return: list(dict), list of dictionaries if multiple hits or a specific entry or None """

        generator = re.compile(regex, flags=flags).finditer(input_string)
        matches = []
        for obj in generator:
            try:
                span_a = obj.span(1)
                group_a = obj.group(1)
            except IndexError:
                span_a = obj.span()
                group_a = obj.group()

            if obj.groups() == ('',):
                # Not sure how to account for this situation yet, weird regex.
                return True

            if group_a not in ignore:
                matches.append({'pattern': regex,
                                'input': input_string,
                                'position': span_a,
                                'position_full': obj.span(),
                                'match': group_a,
                                'match_full': obj.group()})

        if matches:
            for match in matches:
                match.update(metadata)
            if match_index is not None:
                return matches[match_index]
            return matches
        return None