import re


def clean(doc: str) -> str:
    """
    Cleans a string for processing.

    Removes non-alphanumeric characters and extra whitespace.
    Converts to lowercase.

    Parameters:
    doc (str): String to be cleaned

    Returns:
    str: Cleaned string
    """
    # remove non-alphanumeric or space characters
    doc = re.sub(r'[^a-zA-Z0-9 ]', '', doc)
    # trim continous whitespace down to 1 space
    doc = re.sub(r'\s+', ' ', doc)
    doc = doc.lower().strip()
    return doc