Mathematica 9 is now available
 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]:=



    Any questions about topics on this page? Click here to get an individual response.Buy NowMore Information
    THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
    SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.