({{, (RefLink[PatternSequence, paclet:ref/PatternSequence])[(Subscript[p, 1]),(Subscript[p, 2]),…] 
is a pattern object that represents a sequence of arguments matching (Subscript[p, 1]), (Subscript[p, 2]), ….}})

OpenersNotesSection(Spacer1)Details

(RefLink[PatternSequence, paclet:ref/PatternSequence])[] represents a sequence of zero length.

(RefLink[PatternSequence, paclet:ref/PatternSequence]) can appear anywhere inside a pattern but cannot be the only element of a pattern.

OpenersPrimaryExamplesSection(Spacer1)Examples  (4)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Replace a subsequence in a list:

{a,b,c,d,c,d,a,b}/.{x__,PatternSequence[c,d,c],y__}->{x,0,y}

Match a periodic pattern:

{a,b,a,b,a,b,a,b,a,b}/.{PatternSequence[x_,y_]..}->x+y

OpenersExampleSection1(Spacer1)Scope  (2)

f[a|PatternSequence[]]:=x

f[a]

f[]

{{a},{},{a,b}}/.{a|PatternSequence[]}->x

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Repeated, paclet:ref/Repeated])  ▪  (RefLink[Optional, paclet:ref/Optional])  ▪  (RefLink[Alternatives, paclet:ref/Alternatives])  ▪  (RefLink[Pattern, paclet:ref/Pattern])  ▪  (RefLink[Sequence, paclet:ref/Sequence])  ▪  (RefLink[OrderlessPatternSequence, paclet:ref/OrderlessPatternSequence])  ▪  (RefLink[FixedOrder, paclet:ref/FixedOrder])  ▪  (RefLink[KeyValuePattern, paclet:ref/KeyValuePattern])  ▪  (RefLink[SequenceReplace, paclet:ref/SequenceReplace])  ▪  (RefLink[SequenceCases, paclet:ref/SequenceCases])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Pattern Sequences, paclet:tutorial/PatternSequences])}, {▪(RefLinkPlain[Patterns and Transformation Rules, paclet:tutorial/PatternsAndTransformationRules])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Patterns, paclet:guide/Patterns])}})}})

({{(Spacer1), ({{(Spacer1)Related Links}, {(WebLink[DocumentationFooterIconsRelatedLinks-EIWL.png(Spacer1)An Elementary Introduction to the Wolfram Language, https://www.wolfram.com/language/elementary-introduction/41-more-about-patterns.html])(WebLink[: More about Patterns, https://www.wolfram.com/language/elementary-introduction/41-more-about-patterns.html])}})}})