import re


def escape_verbatim_colon(value):
    """Escapes verbatim colon from a value so as it is not confused with a parameter marker.
    """

    # E.g., ':foo, ":foo,   :foo will be replaced with
    # '\:foo, "\:foo,   \:foo respectively
    return re.sub(r"(^(?:'|\")|\s+):", r"\1\:", value)