Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Rules & Patterns > Patterns >

Except

Except[c]
is a pattern object which represents any expression except one that matches c.
Except[c, p]
represents any expression that matches p but not c.
  • Except[c] represents the complement of the set of expressions that match c.
This gives all elements except 0:
Delete all nonvowel characters from a string:
This gives all elements except 0:
In[1]:=
Click for copyable input
Out[1]=
 
Delete all nonvowel characters from a string:
In[1]:=
Click for copyable input
Out[1]=
Except works with patterns and string patterns:
Constraints on patterns:
Get all non-integers:
Find words containing nonword characters:
Strip off all tags "<...>" from an HTML document:
New in 5.1
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team