SequenceSplit
✖
SequenceSplit
splits list into sublists separated by sequences that match the sequence pattern patt.
Details

- SequenceSplit[list,patt] by default gives the list of sublists of list that occur between sequences defined by patt; it does not include the sequences themselves.
- SequenceSplit[list,{patt1rhs1,…,patta,…}] includes rhsi at the position of sequences matching patt1 but omits sequences matching patta.
Examples
open allclose allBasic Examples (3)Summary of the most common use cases
Split at sequences that match a pattern:

https://wolfram.com/xid/09a74swvo-mdfdlq

Insert an expression at the position of the matched sequences:

https://wolfram.com/xid/09a74swvo-dsgafj

Split into at most 2 sublists:

https://wolfram.com/xid/09a74swvo-e43wf4

Scope (6)Survey of the scope of standard use cases
Use a pattern to split the original list:

https://wolfram.com/xid/09a74swvo-b37kmv

Use a rule to replace the matched sequences:

https://wolfram.com/xid/09a74swvo-epwwcl

Split the original list at sequences that match any of the patterns:

https://wolfram.com/xid/09a74swvo-jalbpq

Use a list of rules to replace the matched sequences:

https://wolfram.com/xid/09a74swvo-l0cdj1


https://wolfram.com/xid/09a74swvo-ejkm65

Split into at most 2 sublists:

https://wolfram.com/xid/09a74swvo-fty117

Applications (1)Sample problems that can be solved with this function
Properties & Relations (8)Properties of the function, and connections to other functions
Insert a list of elements at the position of the matched sequence:

https://wolfram.com/xid/09a74swvo-c5xb3k

Use Sequence instead of List to splice the elements in the output list:

https://wolfram.com/xid/09a74swvo-f3zsp3

Rules are tried in the given order:

https://wolfram.com/xid/09a74swvo-gy3hy

https://wolfram.com/xid/09a74swvo-cyivzp


https://wolfram.com/xid/09a74swvo-oyw7if

A list of sublists is considered as a single sequence pattern:

https://wolfram.com/xid/09a74swvo-dknyik


https://wolfram.com/xid/09a74swvo-dbi4k

Use Alternatives to split at any of the sequence subpatterns:

https://wolfram.com/xid/09a74swvo-kxlowg

The third argument of SequenceSplit is the count of sublists not considering insertions:

https://wolfram.com/xid/09a74swvo-bcywg


https://wolfram.com/xid/09a74swvo-d5dbu


https://wolfram.com/xid/09a74swvo-fu432n

Split a list into sublists delimited by sequences that match a pattern:

https://wolfram.com/xid/09a74swvo-llva45

Replace a sequence by an expression:

https://wolfram.com/xid/09a74swvo-gmylfy

Find the position of the sequence:

https://wolfram.com/xid/09a74swvo-juwed5


https://wolfram.com/xid/09a74swvo-e6a7zh


https://wolfram.com/xid/09a74swvo-c121qh

Split at any sequence of integers:

https://wolfram.com/xid/09a74swvo-ddsfo9

Use SequenceCases instead:

https://wolfram.com/xid/09a74swvo-eorbg7

For lists of characters, SequenceSplit is similar to StringSplit:

https://wolfram.com/xid/09a74swvo-h38kyo

https://wolfram.com/xid/09a74swvo-brl07j


https://wolfram.com/xid/09a74swvo-kqok0u


https://wolfram.com/xid/09a74swvo-eieecn

Compare with SplitBy:

https://wolfram.com/xid/09a74swvo-gt0elr

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