ietf
[Top] [All Lists]

Re: Blog: YANG Really Takes Off in the Industry

2014-12-09 13:39:57
On 10/12/2014 03:54, Ted Lemon wrote:
On Dec 9, 2014, at 9:31 AM, t.p. <daedulus(_at_)btconnect(_dot_)com> wrote:
The expression that controls the permissible format of IPv6 addresses in
yang-types is of this ilk.
"       type string {
        pattern '((:|[0-9a-fA-F]{0,4}):)([0-9a-fA-F]{0,4}:){0,5}'
              + '((([0-9a-fA-F]{0,4}:)?(:|[0-9a-fA-F]{0,4}))|'
              + '(((25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])\.){3}'
              + '(25[0-5]|2[0-4][0-9]|[01]?[0-9]?[0-9])))'
              + '(/(([0-9])|([0-9]{2})|(1[0-1][0-9])|(12[0-8])))';
        pattern '(([^:]+:){6}(([^:]+:[^:]+)|(.*\..*)))|'
              + '((([^:]+:)*[^:]+)?::(([^:]+:)*[^:]+)?)'
              + '(/.+)'; "
which was got wrong several times before it became what it is now (which
rings alarm bells for me).

Wow, so there's no way to do this ABNF-style?

In fairness, it took numerous attempts to get the ABNF for the text
representation of IPv6 addresses right, with RFC 6874 being the latest
twist (which, if I am not mistaken, is not covered by the above
gobbledygook; at least, I don't see anything in there that seems
equivalent to '"%25" ZoneID', but maybe I missed it).

    Brian