def splitUrl(line):
    """Splits a tuple at separator characters.

    The separator character is '|'.  These characters can be escaped
    using the backslash sign '\', entries can also be quoted.

    >>> splitUrl('a|b|c')
    ['a', 'b', 'c']
    >>> splitUrl('a\|b|c')
    ['a|b', 'c']
    >>> splitUrl('"a|b"|c')
    ['a|b', 'c']

    Args:
      line  String to split.

    Returns
      List with strings, split at | symbols, excluding these symbols
      themselves.
    """
    pos = 0
    key = ""
    c_quoted = ""
    is_escaped = False
    li = []
    while (pos < len(line)):
        c = line[pos]
        if c_quoted != "":
            if c_quoted == c: c_quoted = ""
            else: key += c                       
        elif is_escaped: 
            key += c
            is_escaped = False
        else:
            if c == '\\': is_escaped = True
            elif c in ['"', "'"]: c_quoted = c
            elif c == '|':
                if key != "":
                    li.append(key)
                    key = ""
            elif c != '\n':
                key += c
                
        pos += 1    
    
    if key != "": li.append(key)

    return li