import re


def sterilize(text):
    """Sterilize input `text`. Remove proceeding and preeceding spaces, and replace spans of
    multiple spaces with a single space.

    Args:
        text (str): text to sterilize.

    Returns:
        sterilized message `text`.
    """
    return re.sub(r'\s+', r' ', text.strip())