import re


def remove_punctuation(text: str) -> str:
    """
    Remove non-alphanumeric characters from a text, replacing them with spaces.

    Parameters
    ----------
    text:
        Text to process.

    Returns
    -------
    text
    """
    # replace non-alphanumeric symbols with spaces
    pattern = r"[^a-zA-Z0-9\s]"
    text = re.sub(pattern, " ", text)

    # collapse to single spaces and strip start/end spaces
    text = re.sub(r"\s+", " ", text).strip()

    return text