Multiple blanks such as x__
allow you to give patterns in which sequences of arbitrary expressions can occur. The Mathematica
pattern repetition operators ..
allow you to construct patterns in which particular forms can be repeated any number of times. Thus, for example, f[a..]
represents any expression of the form f[a]
, f[a, a]
, f[a, a, a]
, and so on.
You can use ..
to represent repetitions of any pattern. If the pattern contains named parts, then each instance of these parts must be identical.
The pattern x..
can be extended to two arguments to control the number of repetitions more precisely.