import re


def replace_continuous_newlines(string: str) -> str:
    """
    Replace more than two continuous newline with two newline.

    :param string: String to be processed
    :type string: str
    :return: Result string
    :rtype: str

    **Example:**

    .. code-block:: python

        string = "Hello\\n\\n\\nWorld!"
        result = replace_continuous_newlines(string) # "Hello\\n\\nWorld!"
    """
    return re.sub(r"\n{3,}", "\n\n", string)