Subject: [Cbor] CDDL: Solving the regexp issue

From: Carsten Bormann <[email-masked]>
Date: Wed, 24 Jan 2018 21:04:25 +0100

At IETF 100, we had a another discussion about regular expressions.
I don’t think we went home with a clear idea of how to solve this problem.
Giving up and just not doing regular expression in the first version of CDDL certainly was one choice.
But, since, there has been time to analyze the issue some more.

Here is a proposal for addressing the regexp issue:

https://cbor-wg.github.io/cddl/matching/draft-ietf-cbor-cddl.html#rfc.section.3.8.3

Why use XSD REs?

* There is a valid normative reference for them.
* There is precedent for using XSD REs in IETF specifications, e.g. in YANG (RFC 7950).
* They actually have been designed for the kind of use we are employing them for (albeit in an XML context).
* There are no undesirable UTF-16 droppings in XSD REs, as there would have been in JavaScript REs.

The solution proposed works quite well and allows us to have a reasonable .regexp in the 1.0 CDDL RFC.
(It is just a tad less straightforward to implement than PCRE was.  Oh well.)

We can always add more controls for other RE types later.  (This also provides a powerful incentive to continue coupling REs with the main extension point for the CDDL language: controls.)

Grüße, Carsten