import re


def normalize_filename(text):
    """ Normalize string for use as a filename. """
    # Replace forbidden characters.
    text2 = re.sub(r'[\/%]+', '_', text)
    # Replace redundant white space, replace tabs/newlines to spaces.
    text3 = re.sub(r'\s+', ' ', text2)
    return text3