Re: [netmod] Potential additions to rfc6087bis: RegEx guidelines

Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de> Wed, 30 August 2017 10:29 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 615301321E3 for <netmod@ietfa.amsl.com>; Wed, 30 Aug 2017 03:29:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Level:
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9] 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 BfZE_IBDTKQW for <netmod@ietfa.amsl.com>; Wed, 30 Aug 2017 03:29:08 -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 CA12B132139 for <netmod@ietf.org>; Wed, 30 Aug 2017 03:29:07 -0700 (PDT)
Received: from localhost (demetrius5.irc-it.jacobs-university.de [10.70.0.222]) by atlas5.jacobs-university.de (Postfix) with ESMTP id 33658F4B; Wed, 30 Aug 2017 12:29:05 +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 v0_V-jK-uPrG; Wed, 30 Aug 2017 12:29:04 +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, 30 Aug 2017 12:29:05 +0200 (CEST)
Received: from localhost (demetrius3.jacobs-university.de [212.201.44.48]) by hermes.jacobs-university.de (Postfix) with ESMTP id 11130200E0; Wed, 30 Aug 2017 12:29:05 +0200 (CEST)
X-Virus-Scanned: amavisd-new at jacobs-university.de
Received: from hermes.jacobs-university.de ([212.201.44.23]) by localhost (demetrius3.jacobs-university.de [212.201.44.32]) (amavisd-new, port 10024) with ESMTP id D6Yzi3He3onT; Wed, 30 Aug 2017 12:29:04 +0200 (CEST)
Received: from elstar.local (elstar.jacobs.jacobs-university.de [10.50.231.133]) by hermes.jacobs-university.de (Postfix) with ESMTP id 8AD3D200AA; Wed, 30 Aug 2017 12:29:04 +0200 (CEST)
Received: by elstar.local (Postfix, from userid 501) id E46C740731A6; Wed, 30 Aug 2017 12:29:02 +0200 (CEST)
Date: Wed, 30 Aug 2017 12:29:02 +0200
From: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
To: Robert Wilton <rwilton@cisco.com>
Cc: Andy Bierman <andy@yumaworks.com>, Xufeng Liu <Xufeng_Liu@jabil.com>, "netmod@ietf.org" <netmod@ietf.org>
Message-ID: <20170830102902.2n5q6rgq2x2dxfq2@elstar.local>
Reply-To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
Mail-Followup-To: Robert Wilton <rwilton@cisco.com>, Andy Bierman <andy@yumaworks.com>, Xufeng Liu <Xufeng_Liu@jabil.com>, "netmod@ietf.org" <netmod@ietf.org>
References: <152f24b2-7947-9c76-714c-af226ab3fe91@tail-f.com> <8760ddc676.fsf@nic.cz> <599F0991.7020900@tail-f.com> <BN3PR0201MB0867A248887538077CD5D49FF19B0@BN3PR0201MB0867.namprd02.prod.outlook.com> <20170825125254.6nhnzkrar6fhu7zr@elstar.local> <BN3PR0201MB086796F09BFD77FCD718C21BF19E0@BN3PR0201MB0867.namprd02.prod.outlook.com> <20170828154640.pzg7jfy5uepkb22q@elstar.local> <c8de6140-af50-0a4b-a479-b011a8dfbbe7@cisco.com> <CABCOCHRNt3Tkxy8Ffz3JGgPe-rQYwZ3MTLmD43OQi4P6tZQJmg@mail.gmail.com> <f7151a6b-9deb-52ad-62a9-78b29a552540@cisco.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Disposition: inline
In-Reply-To: <f7151a6b-9deb-52ad-62a9-78b29a552540@cisco.com>
User-Agent: NeoMutt/20170714 (1.8.3)
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/6GlnIOWo1BLH4sm37EmDmjQqBNA>
Subject: Re: [netmod] Potential additions to rfc6087bis: RegEx guidelines
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, 30 Aug 2017 10:29:10 -0000

On Wed, Aug 30, 2017 at 10:16:30AM +0100, Robert Wilton wrote:
> Hi Andy,
> 
> What I am suggesting makes it easier for readers, because I am a proponent
> of simpler regular expressions that are easy to read and understand.
> 
> For example, I wonder how many YANG model readers would immediately
> comprehend what this pattern statement means:
> 
> pattern "\p{Sc}\p{Zs}?\p{Nd}+\.\p{Nd}{2}"?
> 
> Does allowing such patterns really make it easier for model readers?

This is always difficult to judge but to be fair you have to show how
you express _the same_ (and not a subset) with some other kind of
regular expressions. (My understanding is that \p{Sc} is a currency
symbol.)

> The proposes guidelines obviously make it easier (or at least no harder) for
> tool makers.
> 
> I agree that there is an minor impact to model writers, but really only in
> the sense that the guidelines would be telling them not to use the esoteric
> options of the XML regex syntax that they probably don't know about anyway.

What is 'esoteric' largely depends on your language environment. What
you are saying by 'do not use \p{}' is essentially 'do not use any
unicode long live ASCII'.
 
/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/>