import re


def clean_repeated_symbols(text: str) -> str:
    """Filter text, replacing symbols repeated more than twice (not allowed in most
    languages) with a single repetition of the symbol.

    Arguments:
        text:
            The text to be filtered.

    Returns:
        The filtered text.
    """
    pattern = re.compile(r"(.)\1{2,}", re.DOTALL)
    return pattern.sub(r"\1\1", text)