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

William Lupton <wlupton@broadband-forum.org> Thu, 18 April 2019 13:23 UTC

Return-Path: <wlupton@broadband-forum.org>
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 C08A712008A for <netmod@ietfa.amsl.com>; Thu, 18 Apr 2019 06:23:45 -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, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (2048-bit key) header.d=broadband-forum-org.20150623.gappssmtp.com
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 KvXXaV6z6Hab for <netmod@ietfa.amsl.com>; Thu, 18 Apr 2019 06:23:42 -0700 (PDT)
Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id B01FB120071 for <netmod@ietf.org>; Thu, 18 Apr 2019 06:23:42 -0700 (PDT)
Received: by mail-io1-xd36.google.com with SMTP id b6so1921819iog.0 for <netmod@ietf.org>; Thu, 18 Apr 2019 06:23:42 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadband-forum-org.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=J42+fuILzScj9PbT715pyDUxG+DgecJcMz9Tj4FQStY=; b=NRsugj9BmJvOPLM5nfzNcrrfSfVqobtP8R3YQqmli1YARwGFlac5grNNmcVexk01u5 Lw+F6xLpLWrxf0tLPZTmoQ23kg4cdWG39HxlAtWjqXm7Pf+B0AL/HmbI4QUekod50+qE JYtGh0FQd3gme/qyXul7BnIcmJ80QgDzSA3WkpGQU+m9qLryd9Y+vjFA3CJlIunO2eNW 5+Ra7+9azW98uIFoTRRDxFM+WtsE7DxRTkkXh+0qMVF1Ci+sM4G1JiHT3cZ4oTvKFzuk WY1/2qcXB3OmrA6scwVan/tAl6+EpzppIBDBLonzJLWtfK3AwL2zNeEg2s3o/nsp7sOs UIEw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=J42+fuILzScj9PbT715pyDUxG+DgecJcMz9Tj4FQStY=; b=Fa4l/U2YzIt6b8iZbLNErpSKwkE4rtHd67Ppcr0kQq3CfL8kCD5vmEjFCEVlTKH82K IwrMMLqCkbyKzNH/NINfSGEDb/0HsgFxOMD1lTKHNaqLxlBOskLIdvl6/z8B3yZkhABk 8L1zNmDS80PGmx1L2YWy7w9+2bRCtIQ/rWWgccVVb9fu6FK+l5KBk9Hn2tMuIVf7MsEI Zq1WaUgn31BUUg7fqYH/IgaRsfbg7UEIhsMQMTw8SHokf9utPF72Q/xZ3OsDtw1F0Hlr H13I+Xi5J6xyQzU53cQ9hgjSIHEBLuaqoQsv8NugNsiA4hRqhnlPVP4ZONwdenh8C+o5 26PA==
X-Gm-Message-State: APjAAAUaiK7K+BTOyLDlBLw3o5msIjRvP+UqzomvbfygILns2bqY+Bhr 8IGiTnaIhz8NKP4/CFIjjv+vWry2tiKOGeLNeS4HGw==
X-Google-Smtp-Source: APXvYqwMnPCQbFZR9GPE3xivP/BlACf4tbCRo7+Aw2jB0c7T6wwJtJMjvP9QKzFlfyjk5XGdu7bQoc7QpvtRUow5ECI=
X-Received: by 2002:a6b:4e17:: with SMTP id c23mr61584183iob.212.1555593821906; Thu, 18 Apr 2019 06:23:41 -0700 (PDT)
MIME-Version: 1.0
References: <155535446032.10827.9204466950651701790@ietfa.amsl.com> <0100016a2ec8ed5f-14648cab-7615-4af4-9131-e85bf5826a03-000000@email.amazonses.com>
In-Reply-To: <0100016a2ec8ed5f-14648cab-7615-4af4-9131-e85bf5826a03-000000@email.amazonses.com>
From: William Lupton <wlupton@broadband-forum.org>
Date: Thu, 18 Apr 2019 14:23:30 +0100
Message-ID: <CAEe_xxjkd-fc4KSbAhZog6Q6XQ4YAFK7Wo3UBdKbP_z0Hv+Aew@mail.gmail.com>
To: Kent Watsen <kent+ietf@watsen.net>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Content-Type: multipart/alternative; boundary="0000000000002b86350586cde922"
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/YXGPQxsLNm_P14VLjUYG2QWr6Tk>
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:23:46 -0000

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).

On Thu, 18 Apr 2019 at 05:51, Kent Watsen <kent+ietf@watsen.net> wrote:

>
> Many times in models I want a non-empty version of what XSD calls a
> "token":
>
>     token    A string that does not contain line feeds,
>              carriage returns, tabs, leading or trailing
>              spaces, or multiple spaces.
>
> So how about the following?
>
>   typedef token {
>       type string;
>       length "1.max";         // non-empty (some expr do this already)
>       pattern "[^\n\r\t"]+"   // no LFs, CRs, or Tabs
>       pattern "[^ ].*";       // no leading space     (min-length 1?)
>       pattern ".*[^ ]";       // no trailing space    (min-length 1?)
>       pattern ".*[^ ][^ ].*"  // no multiple spaces   (min-length 2?)
>   }
>
> Kent // contributor
>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
>