I'm pretty sure that someone already did this, i.e. they forked CL-PPCRE for arbitrary sequences. But I can't remember the details right now. You'll probably find a link hidden in the mailing list archives.
Cheers, Edi.
On Wed, Mar 19, 2014 at 1:15 AM, Ron Garret ron@flownet.com wrote:
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