def format_math(expr):
    """Replace math symbols with HTML conterparts

    :param expr: expression to format
    :type expr: str
    :returns: replaced string

    """
    expr2 = expr.replace(".gt.", "&gt;")
    expr2 = expr2.replace(".geq.", "&gt;=")
    expr2 = expr2.replace(".lt.", "&lt;")
    expr2 = expr2.replace(".leq.", "&lt;=")
    expr2 = expr2.replace(".and.", "AND")
    expr2 = expr2.replace(".eq.", "=")
    expr2 = expr2.replace(".neq.", "!=")

    return expr2