import re


def sympy2bnet(rule):
    """Converts a sympy string expression to a BNET string expression.

    Parameters
    ----------
    rule : str
        Boolean expression in sympy format.

    Returns
    -------
    str
        Expression in BNET format.

    """
    crule = re.sub("~","!",rule)
    crule = re.sub("True","1",crule)
    crule = re.sub("False","0",crule)
    return crule