DOCUMENTATION CENTER SEARCH
Mathematica
>
Patterns
>
Built-in
Mathematica
Symbol
Introduction to Patterns
Patterns and Transformation Rules
Naming Pieces of Patterns
Specifying Types of Expression in Patterns
Optional and Default Arguments
Pattern Sequences
Patterns for Some Common Types of Expression
Tutorials »
|
Blank
Optional
PatternTest
StringExpression
See Also »
|
Patterns
String Patterns
Mathematica Syntax
More About »
Pattern
(:)
s
:
obj
represents the pattern object
obj
, assigned the name
s
.
MORE INFORMATION
The name
s
must be a symbol.
The object
obj
can be any pattern object.
When a transformation rule is used, any occurrence of
s
on the right-hand side is replaced by whatever expression it matched on the left-hand side.
The operator
:
has a comparatively low precedence. The expression
x:_+_
is thus interpreted as
x:(_+_)
, not
(x:_)+_
.
The form
s_
is equivalent to
s
:_
. Similarly,
s_h
is equivalent to
s
:_
h
,
s__
to
s
:__
, and so on.
SEE ALSO
Blank
Optional
PatternTest
StringExpression
TUTORIALS
Introduction to Patterns
Patterns and Transformation Rules
Naming Pieces of Patterns
Specifying Types of Expression in Patterns
Optional and Default Arguments
Pattern Sequences
Patterns for Some Common Types of Expression
MORE ABOUT
Patterns
String Patterns
Mathematica Syntax
New in 1
© 2008 Wolfram Research, Inc.