import re


def format_text(text: str):
    """
    Removes unwanted characters
    Replaces spaces with underscores
    """
    whitelist = re.compile(r'[^a-zA-Z ]+')
    return re.sub(whitelist, '', text).replace(' ', '_')