import re


def cleanNodeName(name):
    """
    Return a cleaned version of a string, suitable for naming a node.
    Basically removes anything but alphanumeric characters and dots.
    """
    return re.sub(r'[^a-zA-Z0-9\n\.]', '_', name)