An important feature of string manipulation functions like StringReplace is that they handle not only literal strings but also patterns for collections of strings. This ...
Specifying patterns that involve alternatives. This defines h to give p when its argument is either a or b. The first two cases give p.
You can tell a lot about what "type" of expression something is by looking at its head. Thus, for example, an integer has head Integer, while a list has head List. In a ...
s_1 ~~ s_2 ~~ ... or StringExpression[s_1, s_2, ...] represents a sequence of strings and symbolic string objects s_i.
Patterns stand for classes of expressions. They contain pattern objects that represent sets of possible expressions. Pattern objects. When several pattern objects with the ...
There are a number of important interactions in Mathematica between evaluation and pattern matching. The first observation is that pattern matching is usually done on ...
Mathematica provides a general mechanism for specifying constraints on patterns. All you need to do is to put /;condition at the end of a pattern to signify that it applies ...
Using the objects described in "Introduction to Patterns", you can set up patterns for many kinds of expressions. In all cases, you must remember that the patterns must ...
MatchQ
(Built-in Mathematica Symbol) MatchQ[expr, form] returns True if the pattern form matches expr, and returns False otherwise.
DeleteCases[expr, pattern] removes all elements of expr that match pattern. DeleteCases[expr, pattern, levelspec] removes all parts of expr on levels specified by levelspec ...