Hi, you might want to have a look at micmatch. It has a feature called views: http://martin.jambon.free.fr/micmatch-manual.html#htoc10 Unfortunately it does not work with OCaml 3.10, yet HTH