gives a list of the starting and ending positions at which sublist appears in list.


gives all positions at which sequences matching patt occur in list.


includes only the first n occurrences of patt.

Details and Options


open allclose all

Basic Examples  (2)

Find the positions of a sublist in a list:

Find the positions of all contiguous occurrences of b:

Scope  (5)

Find sequences of integers in a list:

Check the result:

Find sequences of words in a list:

Find sequences of elements that match a pattern, here giving twin primes:

Find sequences in the first 10 million digits of Pi:

Find all overlapping sequences in a list:

Options  (2)

Overlaps  (2)

Allow overlaps:

Allow no overlaps:

Allow overlaps starting at different positions:

Allow no overlaps:

Allow all overlaps:

Properties & Relations  (3)

Find the position of a sequence:

Find the actual sequence:

Find the number of cases:

Replace the sequence by an expression:

For lists of characters, SequencePosition is very similar to StringPosition:

SubsetPosition matches the elements of the sequence in any order:

SequencePosition matches the sequence only in the specified order:

Wolfram Research (2015), SequencePosition, Wolfram Language function,


Wolfram Research (2015), SequencePosition, Wolfram Language function,


Wolfram Language. 2015. "SequencePosition." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (2015). SequencePosition. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2022_sequenceposition, author="Wolfram Research", title="{SequencePosition}", year="2015", howpublished="\url{}", note=[Accessed: 06-July-2022 ]}


@online{reference.wolfram_2022_sequenceposition, organization={Wolfram Research}, title={SequencePosition}, year={2015}, url={}, note=[Accessed: 06-July-2022 ]}