OrderlessPatternSequence
is a pattern object that represents a sequence of arguments matching p1,p2,… in any order.
Details

- OrderlessPatternSequence[] represents a sequence of zero length.
- OrderlessPatternSequence can appear anywhere inside a pattern but cannot be the only element of a pattern.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Match elements of a list in any order:

https://wolfram.com/xid/0bc6zz97w6gyib2-bqdvwf


https://wolfram.com/xid/0bc6zz97w6gyib2-f6d0yy

Match function arguments in any order:

https://wolfram.com/xid/0bc6zz97w6gyib2-tqcaa

The ordering of matched expressions is preserved:

https://wolfram.com/xid/0bc6zz97w6gyib2-el5315


https://wolfram.com/xid/0bc6zz97w6gyib2-ba5j6x

Scope (2)Survey of the scope of standard use cases
Use OrderlessPatternSequence to make some of the function arguments orderless:

https://wolfram.com/xid/0bc6zz97w6gyib2-px7fq

https://wolfram.com/xid/0bc6zz97w6gyib2-pec2w1


https://wolfram.com/xid/0bc6zz97w6gyib2-dilli5

Only the last two arguments of g are orderless:

https://wolfram.com/xid/0bc6zz97w6gyib2-e1rova

Find the positions of lists that have two 1s and one 0:

https://wolfram.com/xid/0bc6zz97w6gyib2-etl25n


https://wolfram.com/xid/0bc6zz97w6gyib2-cbvxna

Properties & Relations (1)Properties of the function, and connections to other functions
During expression pattern matching, PatternSequence matches expressions in fixed order:

https://wolfram.com/xid/0bc6zz97w6gyib2-begbju


https://wolfram.com/xid/0bc6zz97w6gyib2-5gs1ep

OrderlessPatternSequence matches expressions in arbitrary order:

https://wolfram.com/xid/0bc6zz97w6gyib2-ir2ij4


https://wolfram.com/xid/0bc6zz97w6gyib2-buskcg

Possible Issues (1)Common pitfalls and unexpected behavior
OrderlessPatternSequence matches against a sequence of patterns:

https://wolfram.com/xid/0bc6zz97w6gyib2-9f7jhv


https://wolfram.com/xid/0bc6zz97w6gyib2-fz18c5

Wolfram Research (2015), OrderlessPatternSequence, Wolfram Language function, https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html.
Text
Wolfram Research (2015), OrderlessPatternSequence, Wolfram Language function, https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html.
Wolfram Research (2015), OrderlessPatternSequence, Wolfram Language function, https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html.
CMS
Wolfram Language. 2015. "OrderlessPatternSequence." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html.
Wolfram Language. 2015. "OrderlessPatternSequence." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html.
APA
Wolfram Language. (2015). OrderlessPatternSequence. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html
Wolfram Language. (2015). OrderlessPatternSequence. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html
BibTeX
@misc{reference.wolfram_2025_orderlesspatternsequence, author="Wolfram Research", title="{OrderlessPatternSequence}", year="2015", howpublished="\url{https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html}", note=[Accessed: 04-June-2025
]}
BibLaTeX
@online{reference.wolfram_2025_orderlesspatternsequence, organization={Wolfram Research}, title={OrderlessPatternSequence}, year={2015}, url={https://reference.wolfram.com/language/ref/OrderlessPatternSequence.html}, note=[Accessed: 04-June-2025
]}