CESM (Content Expression State Machine) is s a JavaScript toolkit for building state machines that match content expressions.

“Content expression” is a term coined from Prosemirror, where regex-like expressions are used to constrain text editor schemas. CESM can be used for similar purposes.

Like many of my projects, this has primarily been built for my use cases. If you wish to extend the base functionality, you're encouraged to fork the project.