import re


def normalise_shelfmark(sm):
    """Normalize shelfmarks."""
    sm = "".join(sm.split())
    sm = re.sub(r',|\.|;|:', r'', sm)
    sm = re.sub(r'\[|\{', r'\(', sm)
    sm = re.sub(r'\]|\}', r'\)', sm)
    sm = sm.replace('_', '-')
    sm = sm.replace('&', ' & ')
    sm = re.sub(r'(\d+)', lambda m: m.group(1).rjust(7, ' '), sm)
    return sm.upper()