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

Xufeng Liu <Xufeng_Liu@jabil.com> Mon, 28 August 2017 12:59 UTC

Return-Path: <Xufeng_Liu@jabil.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 0F43E1328DB for <netmod@ietfa.amsl.com>; Mon, 28 Aug 2017 05:59:05 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.921
X-Spam-Level:
X-Spam-Status: No, score=-1.921 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=jabil.onmicrosoft.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 079JNWh_ri1W for <netmod@ietfa.amsl.com>; Mon, 28 Aug 2017 05:59:02 -0700 (PDT)
Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0112.outbound.protection.outlook.com [104.47.38.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EAB9F132199 for <netmod@ietf.org>; Mon, 28 Aug 2017 05:59:01 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jabil.onmicrosoft.com; s=selector1-jabil-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=1+3zsr7hMUSYfpW6xSWyO+27tFGqc+BbQqgqSy2XANA=; b=6VeVmPNJZpwaTlDOhA9M8dreU/BbI9X2sx8AgYItrCedE6YqgCAg8B66kM97ZIlYDH6ZfGcgi3H88n62Wz951x2Y9kM2K3Mhz/OcqVri5xgJUXsuOPOxJoyKhfVdB1nH9fzzapIU5ONL6zzgqPO4BX+5JJpcRvhBh+cjZZbgH6I=
Received: from BN3PR0201MB0867.namprd02.prod.outlook.com (10.160.154.13) by BN3PR0201MB1058.namprd02.prod.outlook.com (10.161.209.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.1385.9; Mon, 28 Aug 2017 12:58:59 +0000
Received: from BN3PR0201MB0867.namprd02.prod.outlook.com ([10.160.154.13]) by BN3PR0201MB0867.namprd02.prod.outlook.com ([10.160.154.13]) with mapi id 15.01.1385.014; Mon, 28 Aug 2017 12:58:59 +0000
From: Xufeng Liu <Xufeng_Liu@jabil.com>
To: Juergen Schoenwaelder <j.schoenwaelder@jacobs-university.de>
CC: Per Hedeland <per@tail-f.com>, Ladislav Lhotka <lhotka@nic.cz>, "'netmod@ietf.org'" <netmod@ietf.org>
Thread-Topic: [netmod] Potential additions to rfc6087bis: RegEx guidelines
Thread-Index: AdMcU4SqqeTEr3DWR4ygcD75zJMNgAAS/WQAAAKnWIAAEce1gAAC0wKAACiZxdAAAInsAACWumgg
Date: Mon, 28 Aug 2017 12:58:59 +0000
Message-ID: <BN3PR0201MB086796F09BFD77FCD718C21BF19E0@BN3PR0201MB0867.namprd02.prod.outlook.com>
References: <BN3PR0201MB0867DAD1212DBA2E88570AD5F1850@BN3PR0201MB0867.namprd02.prod.outlook.com> <20170824060900.u5kcffzvwjr7mmob@elstar.local> <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>
In-Reply-To: <20170825125254.6nhnzkrar6fhu7zr@elstar.local>
Accept-Language: en-US
Content-Language: en-US
X-MS-Has-Attach:
X-MS-TNEF-Correlator:
x-dg-ref: PG1ldGE+PGF0IG5tPSJib2R5LnR4dCIgcD0iYzpcdXNlcnNceGxpdVxhcHBkYXRhXHJvYW1pbmdcMDlkODQ5YjYtMzJkMy00YTQwLTg1ZWUtNmI4NGJhMjllMzViXG1zZ3NcbXNnLWE2ZjRkOTg1LThiZjAtMTFlNy05YzI4LTE4NWUwZmUzYzQ1Y1xhbWUtdGVzdFxhNmY0ZDk4Ny04YmYwLTExZTctOWMyOC0xODVlMGZlM2M0NWNib2R5LnR4dCIgc3o9IjE4MzYiIHQ9IjEzMTQ4Mzk4NzM4NTUxNjc2OSIgaD0iS29UckczK2ZsWFlHd2J1Sk8rSTVLd2J3TVNBPSIgaWQ9IiIgYmw9IjAiIGJvPSIxIi8+PC9tZXRhPg==
authentication-results: spf=none (sender IP is ) smtp.mailfrom=Xufeng_Liu@jabil.com;
x-originating-ip: [98.191.72.170]
x-ms-publictraffictype: Email
x-microsoft-exchange-diagnostics: 1; BN3PR0201MB1058; 6:oX5Sf1hiS6eIyYr31LXhd7BVPdN/SerUIf+x8V0od0wbW2gHx//WWw6I5wZ1FIEGkVG8MUHKUF32os580dcRXFs1FKtY8CPWMYiuARvYxd3sPpoPUSE6Zdkj2220HO0w3GBrof0QxfKs/BjeATx1dLFitlGWbaQiFhboAcDsJ1fGZqu0EeeIxumj967y7ltRpF7juT1DDNxw/k99PXV/TSsEp7kAKo5mJR4lKAWNrTIF2RXEytphIXLUMZ7zkZQeReGgSt3ibkyLSQYvQq0a1YAKq/H/fmHyMp8lF6YWaBaVQoR/YoWZWL91SxMmHM5e2++Lqq6wUYoSogiV0s51hQ==; 5:RnWXn4ZwYqTQ7mb4+QR/z5UzeLIwtCV2PjuivJ3dGykcCtuIduDK5FV4FE4rGsH1L6NYNbv+EQkjWebrPR3pq/1HBtqSNfjhNTFlaYJyP+YwoNuoaXamwxtrlajW3V9keT7XprpGf4b4sG0mS0eakA==; 24:mv5ElPkY9ZhZzF/El2AFlbN1EIxV8ZHy4TZK62nDa+bAfegbL6fYl1o5g0J5Ov7rgxHxLOeTCXHgYBI2tdu9G2TQsec/OjJszIAelIsInIo=; 7:YARu5I3ts45VqHjxmomYud2cBadywrBfgz/yHoxJ2Gw/Th0Vk3TdwH5jPsahyB10032Exp/wrZtuUbVoQBKvRlqEzttDnFjeiY60RJwoqLSHxrG2lLRsMhTmWSXjwdFzqZB9+pXCeTf7aa5mD6re8J2XXuw9wmblx6m+tjrhhzaGd+BuSugC+6J6CS6nPY7YXICmUIwUiqM/tv19/QqPijflXlOdtL/Uq2aibv68xEE=
x-ms-exchange-antispam-srfa-diagnostics: SSOS;
x-ms-office365-filtering-correlation-id: 917a371e-81e6-4292-ba6a-08d4ee148ce2
x-ms-office365-filtering-ht: Tenant
x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(2017030254152)(300000503095)(300135400095)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:BN3PR0201MB1058;
x-ms-traffictypediagnostic: BN3PR0201MB1058:
x-exchange-antispam-report-test: UriScan:(788757137089)(21534305686606);
x-microsoft-antispam-prvs: <BN3PR0201MB1058A096273BE09139FD42E4F19E0@BN3PR0201MB1058.namprd02.prod.outlook.com>
x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(100000703101)(100105400095)(10201501046)(93006095)(93001095)(3002001)(6055026)(6041248)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN3PR0201MB1058; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN3PR0201MB1058;
x-forefront-prvs: 0413C9F1ED
x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(6009001)(39860400002)(377454003)(199003)(189002)(52314003)(24454002)(13464003)(53936002)(3660700001)(6506006)(3846002)(102836003)(6116002)(99286003)(54906002)(74316002)(189998001)(55016002)(106356001)(105586002)(4326008)(478600001)(86362001)(97736004)(7696004)(68736007)(66066001)(93886005)(25786009)(2900100001)(3280700002)(72206003)(54356999)(110136004)(6246003)(8936002)(81156014)(50986999)(8676002)(76176999)(80792005)(561944003)(2950100002)(6916009)(81166006)(229853002)(6306002)(9686003)(53546010)(6436002)(2906002)(7736002)(77096006)(33656002)(101416001)(14454004)(5660300001)(305945005); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR0201MB1058; H:BN3PR0201MB0867.namprd02.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en;
received-spf: None (protection.outlook.com: jabil.com does not designate permitted sender hosts)
spamdiagnosticoutput: 1:99
spamdiagnosticmetadata: NSPM
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-OriginatorOrg: jabil.com
X-MS-Exchange-CrossTenant-originalarrivaltime: 28 Aug 2017 12:58:59.4008 (UTC)
X-MS-Exchange-CrossTenant-fromentityheader: Hosted
X-MS-Exchange-CrossTenant-id: bc876b21-f134-4c12-a265-8ed26b7f0f3b
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN3PR0201MB1058
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/p_jQ0tN2DUkitO7W2yjfjQfmVxw>
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: Mon, 28 Aug 2017 12:59:05 -0000


> -----Original Message-----
> From: Juergen Schoenwaelder [mailto:j.schoenwaelder@jacobs-university.de]
> Sent: Friday, August 25, 2017 8:53 AM
> To: Xufeng Liu <Xufeng_Liu@jabil.com>
> Cc: Per Hedeland <per@tail-f.com>; Ladislav Lhotka <lhotka@nic.cz>;
> 'netmod@ietf.org' <netmod@ietf.org>
> Subject: Re: [netmod] Potential additions to rfc6087bis: RegEx guidelines
> 
> On Fri, Aug 25, 2017 at 12:40:18PM +0000, Xufeng Liu wrote:
> >
> > > I did not see a proposed change to the standard YANG specification
> > > regarding the regexp flavor, only a proposal that module authors
> > > SHOULD show consideration for implementations that don't comply with
> > > the standard.
> > >
> 
> > [Xufeng] This is the point.
> 
> Perhaps this did not come out properly.
> 
> Anyway, why would I as a YANG author have to replace \d with [0..9] so that
> implementations that can't handle \d are happy? An implementation can easily
> do this substitution itself before passing the pattern to the regex engine it
> prefers to use. (I think this is what libyang is actually doing, I think it uses pcre
> internally.)
> 
> YANG 1.0 and 1.1 are pretty clear which pattern syntax they use.
> Implementations should try to support that.

[Xufeng] [0..9] is still compliant with the XSD pattern specified by YANG 1.0 and 1.1. Using [0..9] instead of [\d] will make the implementations with native POSIX RegEx easier without the need for a tool to inspect every element of the RegEx pattern.

> 
> /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/>