def setExpression( expr ):
    """Handles IP expressions of the form:
          <exp> = <exp> [-- <exp> | ++ <exp> | ^^ <exp>]*"""
    subexp, expr = splitAt( expr, multifind( expr, ['--', '++', '^^'] ) )
    accum = setFromList( pattern( subexp ) )
    while expr != '':
        op, expr = splitAt( expr, 2 )
        subexp, expr = splitAt( expr, multifind( expr, ['--', '++', '^^'] ) )
        accum = doOp( op, accum, setFromList( pattern( subexp ) ) )
    return iter( setToList( accum ) )
Handles IP expressions of the form:
          <exp> = <exp> [-- <exp> | ++ <exp> | ^^ <exp>]*
recipes/Python/355531_Simple_patternbased_string/recipe-355531.py