Welcome to RegEx4Seq
This is a python library that implements regular-expression based pattern matches for sequences of arbitrary objects. For example you can write pattern to determine if a list is a sequence of alternating 1's and 0's like this:
from regex4seq import Item, Items
pattern = Item(1).optional() & Items(0, 1).repeat() & Item(0).optional()
pattern.matches( [1, 0, 1, 0, 1, 0, 1])
pattern.matches( [1, 0, 1, 0, 1, 0, 0])
To learn more about the library, go to the documentation page on ReadTheDocs.