import re


def normalize(xname):
    """
    Normalize input string for use as a tdex_id
    """
    nrgx = r'[\'`\-\?!%&\*@\(\)#:,\.\/\\;\+=\[\]\{\}\$\<\>]'
    urgx = r'[ ★☆]'
    return re.sub(urgx, '_', re.sub(nrgx, '', xname)).lower().strip()