Subject: [Cbor] ABNF in place of regex (Was: Re: CDDL: Solving the regexp issue)

From: Pete Cordell <[email-masked]>
Date: Fri, 30 Mar 2018 13:09:10 +0100

Thinking laterally, if specifying a regex format is problematic, is it 
worth considering ABNF as an alternative?

The pipe character could act as a suitable delimiter.  For example:

    triple-digit = tstr .abnf | 1*DIGIT "." 1*DIGIT "." 1*DIGIT |

Over multiple lines it could look like:

    triple-digit = tstr .abnf |
         1*DIGIT "." 1*DIGIT "." 1*DIGIT
    |

The ABNF could be loosely defined; as in:

    opague-abnf = *( text / NOT-PIPE )
    NOT-PIPE = CRLF / %x20-5B / %x7D-10FFFD

It's more verbose. And it's unconventional.  But...

Pete.
-- 
---------------------------------------------------------------------
Pete Cordell
http://json-content-rules.org Rule
---------------------------------------------------------------------