PatternSequence

PatternSequence[p1,p2,]

is a pattern object that represents a sequence of arguments matching p1, p2, .

Details

  • PatternSequence[] represents a sequence of zero length.
  • PatternSequence can appear anywhere inside a pattern but cannot be the only element of a pattern.

Examples

open allclose all

Basic Examples  (2)

Replace a subsequence in a list:

Match a periodic pattern:

Scope  (2)

Introduced in 2007
 (6.0)