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
- In SubsetPosition[list,patt], patt can be an expression with head List that includes pattern constructs such as PatternSequence, Repeated (..), Blank (_) and BlankSequence (__).
- The pattern patt can also be a pattern that matches a list but does not itself have head List.
- With the default option setting OverlapsTrue, SubsetPosition includes sublists that overlap. With the setting OverlapsFalse, such sublists are excluded.
Examples
open allclose allProperties & Relations (1)
The order within each result of SubsetPosition is determined by the pattern:
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