DOCUMENTATION CENTER SEARCH
Mathematica
>
Patterns
>
Built-in
Mathematica
Symbol
Patterns Involving Alternatives
Patterns for Some Common Types of Expression
String Patterns
Tutorials »
|
Optional
Except
Cases
StringExpression
See Also »
|
Language Overview
Patterns
Rules & Patterns
String Patterns
Mathematica Syntax
Defining Variables and Functions
More About »
Alternatives
(|)
p
1
|
p
2
|
...
is a pattern object which represents any of the patterns
p
i
.
MORE INFORMATION
If a named pattern such as
x_
appears in
p
i
that are not used in a particular match, then the named pattern is taken to have a value that is a zero-length sequence
Sequence
[]
.
EXAMPLES
CLOSE ALL
Basic Examples
(1)
Replace instances of either
a
or
b
:
In[1]:=
Out[1]=
Scope
(1)
SEE ALSO
Optional
Except
Cases
StringExpression
TUTORIALS
Patterns Involving Alternatives
Patterns for Some Common Types of Expression
String Patterns
MORE ABOUT
Language Overview
Patterns
Rules & Patterns
String Patterns
Mathematica Syntax
Defining Variables and Functions
New in 2
© 2008 Wolfram Research, Inc.