'Parse a URL expression
@param key: the key for the URL variable
@return: tuple (selectors, operator, invert)'

@staticmethod
def parse_expression(key):

    if (key[(-1)] == '!'):
        invert = True
    else:
        invert = False
    fs = key.rstrip('!')
    op = None
    if ('__' in fs):
        (fs, op) = fs.split('__', 1)
        op = op.strip('_')
    if (not op):
        op = 'eq'
    if ('|' in fs):
        selectors = [s for s in fs.split('|') if s]
    else:
        selectors = [fs]
    return (selectors, op, invert)
