Re: [netmod] Pattern statements [was Re: Query about augmenting module from submodule in YANG 1.0]

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Wed, 23 August 2017 17:47 UTC

Return-Path: <j.schoenwaelder@jacobs-university.de>
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 413DD13239C for <netmod@ietfa.amsl.com>; Wed, 23 Aug 2017 10:47:40 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.899
X-Spam-Level:
X-Spam-Status: No, score=-1.899 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, URIBL_BLOCKED=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 CLzoWjJj46uL for <netmod@ietfa.amsl.com>; Wed, 23 Aug 2017 10:47:37 -0700 (PDT)
Received: from atlas5.jacobs-university.de (atlas5.jacobs-university.de [212.201.44.20]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 7967913213F for <netmod@ietf.org>; Wed, 23 Aug 2017 10:47:37 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id 51C9B3C; Wed, 23 Aug 2017 19:47:36 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from atlas5.jacobs-university.de ([10.70.0.217]) by localhost (demetrius5.jacobs-university.de [10.70.0.222]) (amavisd-new, port 10032) with ESMTP id tqxfwHvdSMDn; Wed, 23 Aug 2017 19:47:35 +0200 (CEST)
Received: from hermes.jacobs-university.de (hermes.jacobs-university.de [212.201.44.23]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "hermes.jacobs-university.de", Issuer "Jacobs University CA - G01" (verified OK)) by atlas5.jacobs-university.de (Postfix) with ESMTPS; Wed, 23 Aug 2017 19:47:36 +0200 (CEST)
Received: from localhost (demetrius4.jacobs-university.de [212.201.44.49]) by hermes.jacobs-university.de (Postfix) with ESMTP id 1660D200E2; Wed, 23 Aug 2017 19:47:36 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius4.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id el8OlLZp0NDP; Wed, 23 Aug 2017 19:47:35 +0200 (CEST)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id A56DA200E0; Wed, 23 Aug 2017 19:47:35 +0200 (CEST)
Received: by elstar.local (Postfix, from userid 501) id 5351E404A05D; Wed, 23 Aug 2017 19:47:35 +0200 (CEST)
Date: Wed, 23 Aug 2017 19:47:35 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Robert Wilton <rwilton@cisco.com>
Cc: "netmod@ietf.org" <netmod@ietf.org>
Message-ID: <20170823174735.cdp5vrryaqas7l6g@elstar.local>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Robert Wilton <rwilton@cisco.com>, "netmod@ietf.org" <netmod@ietf.org>
References: <1502290869.16638.15.camel@nic.cz> <20170809151312.GC42207@elstar.local> <6ef68131-f731-0edc-b731-d7ec85924f03@cisco.com> <E3378E0605547F4E854DEE0CB1116AB021CE2D@gbcdcmbx03.intl.att.com> <D5C05EB3.C2681%acee@cisco.com> <7614040f-9f8f-09c2-1854-63ad9ffb6be1@cisco.com> <5929631c-e51d-ae66-52d1-cbc87ca3506b@transpacket.com> <321a45fb-77e1-23c7-184b-d3bff9d41c39@cisco.com> <20170823133657.76s5wbcxbpgjfkiy@elstar.local> <1dc6969a-af55-e28a-447f-ad5092d26ec1@cisco.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <1dc6969a-af55-e28a-447f-ad5092d26ec1@cisco.com>
User-Agent: NeoMutt/20170714 (1.8.3)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/dDPTW8Vdi2c9q_qD_pY17g2-0FI>
Subject: Re: [netmod] Pattern statements [was Re: Query about augmenting module from submodule in YANG 1.0]
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.22
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: Wed, 23 Aug 2017 17:47:40 -0000

On Wed, Aug 23, 2017 at 05:55:59PM +0100, Robert Wilton wrote:
> My definition of 'better' is:
> - is relatively easy for a human to read/review.

likely subjective

> - doesn't exclude any valid values.

obviously

> - doesn't check numerical ranges, only the number of digits.

seems arbitrary, why are numerical ranges special?

> - is simple enough to trivially work with most normal regex engines.

and I thought we rely on a standard...

> - otherwise the pattern is as strict as possible given the constraints
> above.

> > So here is the point I think:
> > 
> >     It is desirable that regexes are as strict as they can be.
> >     However, if regexes become so complicated that they become a
> >     verification and maintenance problem by themself, then less strict
> >     regexes may be a better choice.
> I partly agree, but the line of where I would define a regex as being too
> complicated may be different from you ;-).

Very likely and as frustrating as it is, there likely is no precise
guideline that does not leave room for interpretation. For me, the
more complex the pattern gets (and my bar for 'complex' is very low),
the more I am interested in test cases (valid data that must be
accepted by the pattern and invalid data that must be rejected by the
pattern). But yes, all this is somewhat subjective.

/js

-- 
Juergen Schoenwaelder           Jacobs University Bremen gGmbH
Phone: +49 421 200 3587         Campus Ring 1 | 28759 Bremen | Germany
Fax:   +49 421 200 3103         <http://www.jacobs-university.de/>