import re


def search_by_regex(nodes: list, option: int, regex: str) -> list:
    """
    Return all :param regex matched values from :param nodes at :param option index.

    :param nodes: list of nodes.
    :param option: Index in the nodes list(check constants at the start of this file).
    :param regex: Pattern to be found.
    :return: Return list of matched values as list.
    """
    answers = []
    for item in nodes:
        if re.search(regex, item[option]):
            answers.append(item[option])
    return answers