def strip_leading_trailing_punctuation(word):
    """ Remove any leading of trailing punctuation (non-alphanumeric characters
    """
    start_index = 0
    end_index = len(word)
    while start_index < len(word) and not word[start_index].isalnum():
        start_index +=1
    while end_index > 0 and not word[end_index - 1].isalnum():
        end_index -= 1

    # If the word was only non-alphanumeric, we could get into a strange case
    if (end_index <= start_index):
        return ''
    else:
        return word[start_index:end_index]