import re


def words(text: str) -> list[str]:
    """
    Splits text into an array of its words.  Splits at all spaces and trims any punctuation.

    Parameters
    ------------
    text: str
        The text to be split up.

    Returns
    ------------
    str[]
        An array of strings (words)
    """
    list_words = re.split(' |\n|\t', text) #Splits along spaces
    for i in range(0, len(list_words)):
        list_words[i] = re.sub(r'\.|\?|!|\,|\;|\"|\(|\)|\:|\/|\“|\”', '', list_words[i])
    
    list_words = filter(str.strip, list_words) #Strips leading/trailing whitespaces 
                                                #and filters out 'sentences' that are only whitespace
    return list(list_words)