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 >
Pattern Matching Functions
Pattern matching makes possible some of the most succinct and elegant programs in the Mathematica language—immediately compressing large numbers of conditional cases into simple, readable and efficient pattern specifications.
Cases a list of elements matching a pattern
Position positions of elements matching a pattern
Count a count of occurrences of a pattern
    
ReplaceAll (/.) replace all occurrences of a pattern
DeleteCases delete all occurrences of a pattern
    
Set (=), SetDelayed (:=) — define transformations for patterns
    
MemberQ test if any member of a list matches a pattern
FreeQ test if an expression is free of a pattern
MatchQ test whether an expression matches a pattern
Patterns for Part Specifications
TUTORIALS
MORE ABOUT
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team