import re


def cue_to_filename(cue):
    """Given a cue as text, return a filename string. All characters other than
    alphanumerics are replaced by underscores."""
    return re.sub(r'[^A-Za-z0-9]', '_', cue)