Re: [netmod] rfc6991-bis: "token" type?

Jan Lindblad <janl@tail-f.com> Thu, 18 April 2019 13:28 UTC

Return-Path: <janl@tail-f.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id BCA1512032F for <netmod@ietfa.amsl.com>; Thu, 18 Apr 2019 06:28:46 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id r3pZmDy7iNyV for <netmod@ietfa.amsl.com>; Thu, 18 Apr 2019 06:28:45 -0700 (PDT)
Received: from mail.tail-f.com (mail.tail-f.com [46.21.102.45]) by ietfa.amsl.com (Postfix) with ESMTP id 415A212013B for <netmod@ietf.org>; Thu, 18 Apr 2019 06:28:45 -0700 (PDT)
Received: from [192.168.1.185] (213-67-237-150-no99.tbcn.telia.com [213.67.237.150]) by mail.tail-f.com (Postfix) with ESMTPSA id 8D5F01AE0451; Thu, 18 Apr 2019 15:28:44 +0200 (CEST)
Content-Type: text/plain; charset="us-ascii"
Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\))
From: Jan Lindblad <janl@tail-f.com>
In-Reply-To: <CAEe_xxjkd-fc4KSbAhZog6Q6XQ4YAFK7Wo3UBdKbP_z0Hv+Aew@mail.gmail.com>
Date: Thu, 18 Apr 2019 15:28:43 +0200
Cc: "netmod@ietf.org" <netmod@ietf.org>
Content-Transfer-Encoding: quoted-printable
Message-Id: <01B44D68-ABB5-47FE-BA8E-69482334D0F6@tail-f.com>
References: <155535446032.10827.9204466950651701790@ietfa.amsl.com> <0100016a2ec8ed5f-14648cab-7615-4af4-9131-e85bf5826a03-000000@email.amazonses.com> <CAEe_xxjkd-fc4KSbAhZog6Q6XQ4YAFK7Wo3UBdKbP_z0Hv+Aew@mail.gmail.com>
To: William Lupton <wlupton@broadband-forum.org>, Kent Watsen <kent+ietf@watsen.net>
X-Mailer: Apple Mail (2.3445.102.3)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/7RMudCoK0pjZAh-CezIZb8C6srY>
Subject: Re: [netmod] rfc6991-bis: "token" type?
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.29
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 18 Apr 2019 13:28:47 -0000

William, Kent,

> Does the last pattern work? I think it matches any string with two consecutive non-spaces, e.g. "AA  AA" ("AA" + two-spaces + "AA").
> 
> To prevent multiple spaces I think we probably need something like "([^ ]+ )*[^ ]+" (which replaces the last three patterns).
> 
> Do XML regexes support \S (not-whitespace)? If so then I think that "(\S+ )*\S+" covers everything (although also excludes FF and any other whitespace characters if there are any).

William is right in his observation. I had on my todo list to point this out, but I got side tracked :)
An easy way to express this in YANG (1.1) is:

// reject values with two consecutive spaces
pattern "  " { // two spaces
  modifier invert-match;
}

/jan