The theory of regular expressions can be applied to any kind of sequence, not just strings. This would be potentially useful for pattern-matching applications, where current approaches make it very cumbersome to say things like, “Match a list containing between three and five integers”. This sort of thing is easy to express in CL-PPCRE tree-like notation as, e.g. (:repetition (:type integer) 3 5)
My question is: how hard would be it be to adapt the CL-PPCRE code to handle things like this? Is there a sequence-type-agnostic core in CL-PPCRE that could be easily re-used for this purpose, or is the assumption that regexps only apply to strings woven deeply into the code?
Thanks, rg