import re


def sanitize_text(usage_text):
    """Clean up usage text so that it only includes alphanumeric characters """
    # entire text might be enclosed in parantheses
    if usage_text[0] == '(' and usage_text[-1] == ')':
        usage_text = usage_text[1:len(usage_text) - 1]
    
    # remove all paranthetical phrases, inside of parantheses or square brackets
    usage_text = re.sub(r'\([^)]*\)', '', usage_text)
    # or square brackets
    usage_text = re.sub(r'\[[^)]*\]', '', usage_text)
        
    # strip all non-alphanumeric characters from string except for periods and apostrophes
    # to allow names like St. John's
    usage_text = re.sub(r"[^\w.']+", ' ', usage_text)
    
    # replace multiple spaces with a single space
    usage_text = re.sub('[\t+\s+]',' ',usage_text)
    
    return usage_text.strip()