PatternSequence

PatternSequence[p1,p2,]
is a pattern object which represents a sequence of arguments matching , , .

DetailsDetails

  • PatternSequence[] represents a sequence of zero length.
  • PatternSequence can appear anywhere inside a pattern but cannot be the only element of a pattern.

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Replace a subsequence in a list:

In[1]:=
Click for copyable input
Out[1]=

Match a periodic pattern:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2007
(6.0)