import re


def _filter_external_axis_name(axis_name):
    """
    Axis name must be formatted to match Maya's attribute name requirements
    This is typically cameCase. More specifially, the name can't contain spaces
    or special characters
    :param axis_name: str, raw user input for external axis name
    :return axis_name: str, filtered string for user-supplied axis name
    """

    # Replace spaces with underscores
    axis_name = axis_name.replace(' ', '_')
    # Remove special characters
    axis_name = ''.join(re.findall(r"[_a-zA-Z0-9]+", axis_name))

    return axis_name