import re


def split_escaped_delim (delimiter, string, count=0):
    """
    Returns the result of splitting ``string`` with ``delimiter``. It is an
    extension of ``string.split(delimiter, count)`` in that it ignores instances
    of the delimiter being escaped or contained within a string.

    :``delimiter``: The delimiter to split the string with. *Required*.
    :``string``: The string to be split. *Required*.
    :``count``: How many strings to limit the match to. *Default 0*.
    """
    assert len(delimiter) == 1

    split_expression = re.compile(r"""(?<!\\)%s""" % (delimiter))

    result = split_expression.split(string, count)

    return result