import re


def title_year(m_file):
    """
    Regex searching returns the title and year from the filename

    Currently optimized for: "Title (year).extension"
    """
    name = re.compile(r'([\w+\W?]+)\s\(([0-9]{4})\)[\s\w]*[\d\.\d]*[\s\w]*\.\w{2,4}')

    fsearch = name.search(m_file)
    if fsearch:
        title = fsearch.group(1)
        year = fsearch.group(2)
    else:
        print('No match for {}'.format(m_file))
        title = None
        year = None

    return title, year