SubsetPosition

SubsetPosition[list,sublist]

gives a list of positions at which sublist appears in list in any order.

SubsetPosition[list,patt]

gives all positions at which sublists matching patt in any order appear in list.

SubsetPosition[list,patt,n]

includes only the first n positions.

Details and Options

Examples

open allclose all

Basic Examples  (1)

Find the positions of a sublist in a list:

Options  (1)

Overlaps  (1)

Allow overlaps:

Allow no overlaps:

Properties & Relations  (1)

The order within each result of SubsetPosition is determined by the pattern:

Extract subsets corresponding to each result:

Verify that each subset matches the pattern:

Wolfram Research (2020), SubsetPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/SubsetPosition.html.

Text

Wolfram Research (2020), SubsetPosition, Wolfram Language function, https://reference.wolfram.com/language/ref/SubsetPosition.html.

CMS

Wolfram Language. 2020. "SubsetPosition." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/SubsetPosition.html.

APA

Wolfram Language. (2020). SubsetPosition. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/SubsetPosition.html

BibTeX

@misc{reference.wolfram_2024_subsetposition, author="Wolfram Research", title="{SubsetPosition}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/SubsetPosition.html}", note=[Accessed: 18-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_subsetposition, organization={Wolfram Research}, title={SubsetPosition}, year={2020}, url={https://reference.wolfram.com/language/ref/SubsetPosition.html}, note=[Accessed: 18-December-2024 ]}