import re


def find_string_in_grouping(groups, pattern):
    """
    Searches for a string in an array structure of strings. Performs DFS.
    :param groups: Strings grouped by arrays with no bound on subgroups.
    :param pattern: str; The key string to search for; it is a regex search.
    :return: list[int]; Full index of the first match.
    """
    for (index, value) in enumerate(groups):
        assert isinstance(value, (list, str))
        if isinstance(value, str):
            if re.search(pattern, value):
                return [index]
        else:
            submatch = find_string_in_grouping(value, pattern)
            if submatch:
                index = [index]
                index.extend(submatch)
                return index
    return None