def _split_left(val, sep):
    """Split a string by a delimiter which can be escaped by \\"""
    result = []
    temp = u""
    escaped = False
    index = 0
    left = True
    for c in val:
        left = False
        temp += c
        if c == sep[index] and not escaped:
            index += 1
        else:
            index = 0
            if c == u"\\":
                escaped ^= True
            else:
                escaped = False
        if index >= len(sep):
            left = True
            index = 0
            result.append(temp[:-len(sep)])
            temp = u""
    if temp or left:
        result.append(temp)
    return result