chickadee » byte-sequence » byte-sequence-find

byte-sequence-find NEEDLE HAYSTACKprocedure

Finds all non-overlapping instances of the byte-sequence NEEDLE in the byte-sequence HAYSTACK. The first element of the returned list is the prefix of HAYSTACK prior to any matches of NEEDLE. The second is a list of lists.

The first element of each pair in the list is a span from the beginning of a match to the beginning of the next match, while the second is a span from the beginning of the match to the end of the input.