def upper_sel(text, ref):
    for c in text:
        if c.isalpha():
            if c in ref:
                text = text.replace(c, c.upper())
        elif c.isdigit():
            pass
        else:
            text = text.replace(c, ' ')
    return text
