Mathematica 9 is now available
THIS IS DOCUMENTATION FOR AN OBSOLETE PRODUCT.
SEE THE DOCUMENTATION CENTER FOR THE LATEST INFORMATION.
Mathematica > Core Language > Rules & Patterns > Patterns > Repeated (..) >

Repeated

p.. or Repeated[p]
is a pattern object that represents a sequence of one or more expressions, each matching p.
Repeated
represents up to max expressions matching p.
Repeated
represents between min and max expressions matching p.
Repeated
represents exactly n expressions matching p.
  • p.. can appear as an argument of any function. It represents any sequence of arguments.
  • All the objects in the sequence represented by p.. must match p, but the objects need not be identical.
  • The expression p may, but need not, itself be a pattern object.
Replace any list of 's by :
Replace any list of 's with one argument:
Replace any list of 's by :
In[1]:=
Click for copyable input
Out[1]=
 
Replace any list of 's with one argument:
In[1]:=
Click for copyable input
Out[1]=
represents a sequence of 's inside any head:
Replace any list of 's with length up to 3:
Replace any list of 's with lengths between 2 and 3:
Replace lists with lengths between 0 and 3:
Replace lists of length exactly 3:
Define a function that takes as an argument any list of pairs:
Use parentheses or spaces to indicate that is not followed by a dot:
New in 1 | Last modified in 6
Ask a question about this page  |  Suggest an improvement  |  Leave a message for the team
Format:   HTML  |  CDF