import re


def sanitize_set_password_syntax(msg):
    """
    Captures variations of the SET PASSWORD syntax. See:https://mariadb.com/kb/en/library/set-password/
    """
    if "SET PASSWORD" in msg.upper():
        msg = re.sub(r"=.*('|\")(\)?)", '= ***', msg, flags=re.IGNORECASE)
    return msg