This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.1)

Pattern Sequences

In some cases you may need to specify pattern sequences that are more intricate than things like x__ or x..; for such situations you can use PatternSequence[p1, p2, ...].
PatternSequence[p1,p2,...]a sequence of arguments matching p1, p2, ...

Pattern sequences.

This defines a function with two or more arguments, grouping the first two.
Click for copyable input
Evaluate the function for different numbers of arguments.
Click for copyable input
This picks out the longest run of the sequence a, b in the list.
Click for copyable input
The empty sequence, PatternSequence[], is sometimes useful to specify an optional argument.
This picks out expressions with exactly one or two arguments.
Click for copyable input