This is documentation for Mathematica 3, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)
 Documentation / Mathematica / Built-in Functions / Programming / Pattern Matching  /
BlankSequence

  • __ (two _ characters) or BlankSequence[ ] is a pattern object that can stand for any sequence of one or more Mathematica expressions.
  • __ h or BlankSequence[ h ] can stand for any sequence of one or more expressions, all of which have head h.
  • See notes for BlankNullSequence.
  • See the Mathematica book: Section 2.3.8.

    Further Examples

    BlankSequence differs from BlankNullSequence in that it must have at least one expression to match. g[a,b,c] matches the definition for g but there is no match for g[a].

    In[1]:=

    In[2]:=

    Out[2]=

    In[3]:=

    Out[3]=

    In[4]:=