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

Benoit Claise <bclaise@cisco.com> Tue, 29 August 2017 07:39 UTC

Return-Path: <bclaise@cisco.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 814891323C6 for <netmod@ietfa.amsl.com>; Tue, 29 Aug 2017 00:39:11 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -14.5
X-Spam-Level:
X-Spam-Status: No, score=-14.5 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.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 vdD8bDPRYYj0 for <netmod@ietfa.amsl.com>; Tue, 29 Aug 2017 00:39:10 -0700 (PDT)
Received: from aer-iport-3.cisco.com (aer-iport-3.cisco.com [173.38.203.53]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 966091326DF for <netmod@ietf.org>; Tue, 29 Aug 2017 00:39:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=1052; q=dns/txt; s=iport; t=1503992349; x=1505201949; h=subject:to:references:from:message-id:date:mime-version: in-reply-to:content-transfer-encoding; bh=SBwRodBKp4gdL/2a8eZgvMW8aQaDKkkcSEmHJv9jWSA=; b=Y2aylBJABWCZy/UnX7yjjPs05Jr7+4PBvUcMREhj2pCBVRAvFZxlUwB+ uz6J55CWYIAAANdTol4Xthy15ms22wHlfxVAHsra18fTmr4oAiOL3aYAh J7eUkxeutEyoxVcrIlomYB/KfoXJPljS8MBe+4mTYbfxUIe8MVX1ae6mk E=;
X-IronPort-AV: E=Sophos;i="5.41,444,1498521600"; d="scan'208";a="655272725"
Received: from aer-iport-nat.cisco.com (HELO aer-core-1.cisco.com) ([173.38.203.22]) by aer-iport-3.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Aug 2017 07:39:07 +0000
Received: from [10.55.221.36] (ams-bclaise-nitro3.cisco.com [10.55.221.36]) by aer-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id v7T7d4Xm004248; Tue, 29 Aug 2017 07:39:04 GMT
To: Xufeng Liu <Xufeng_Liu@jabil.com>, Per Hedeland <per@tail-f.com>, Ladislav Lhotka <lhotka@nic.cz>, "'netmod@ietf.org'" <netmod@ietf.org>, "Pieter Lewyllie (pilewyll)" <pilewyll@cisco.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> <BN3PR0201MB086796F09BFD77FCD718C21BF19E0@BN3PR0201MB0867.namprd02.prod.outlook.com> <20170828154640.pzg7jfy5uepkb22q@elstar.local>
From: Benoit Claise <bclaise@cisco.com>
Message-ID: <68e772f6-327e-268c-522b-3b480cccbdb4@cisco.com>
Date: Tue, 29 Aug 2017 09:39:05 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.3.0
MIME-Version: 1.0
In-Reply-To: <20170828154640.pzg7jfy5uepkb22q@elstar.local>
Content-Type: text/plain; charset="utf-8"; format="flowed"
Content-Transfer-Encoding: 7bit
Content-Language: en-US
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/mSigPgh14PEMvYj9tqY-MFqaFYg>
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: Tue, 29 Aug 2017 07:39:11 -0000

In this discussion, let's keep in mind that the openconfig modules use 
the POSIX regex while the IETF uses the W3C regex.
So for operators that have to deal with a mix of openconfig and IETF 
modules, this type of advice could be handy from a tooling point of 
view. Such advice, if not in RFC6087bis, could be provided in the yangre 
tool or in its GUI equivalent: https://yangcatalog.org/yangre

Regards, Benoit
> On Mon, Aug 28, 2017 at 12:58:59PM +0000, Xufeng Liu wrote:
>> [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.
> Yes, but then \d is legal in YANG (and it is used in a couple of
> published RFCs).
>
> Educating _all_ module authors to write [0..9] instead of \d will
> likely be more expensive than improving the code of implementations
> that did not implement YANG entirely to accept \d.
>
> /js
>