import re


def extract_episode(text, seg_search, eg_search):
    """
    Extract episode number from metadata.

    :param str text: Metadata containing episode number.
    :param str seg_search: Regex for a `Super Easy German` episode.
    :param str eg_search: Regex for an `Easy German` episode.
    :return: Episode number and type.
    :rtype: dict
    """
    seg_match = re.search(seg_search, text, re.IGNORECASE)
    if seg_match:
        return {
            'type': 'super_easy_german',
            'number': seg_match.group().strip().replace('(', '').replace(
                ')', '')
        }
    eg_match = re.search(eg_search, text, re.IGNORECASE)
    if eg_match:
        return {
            'type': 'easy_german',
            'number': eg_match.group().strip()
        }