import re


def _extract_by_pattern(pattern, line):
    """
    Simply matches pattern and search by regex in given line.

    :param pattern: regex pattern to match.
    :param line: line for matching.
    :return: matched values.
    """
    try:
        res = ''.join(re.findall(pattern, line)).strip()

    except AttributeError:
        res = ''
    return res