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:

Introduced in 2020
 (12.1)