Re: [apps-discuss] Fun with URLs and regex

Mark Nottingham <mnot@mnot.net> Thu, 08 January 2015 15:07 UTC

Return-Path: <mnot@mnot.net>
X-Original-To: apps-discuss@ietfa.amsl.com
Delivered-To: apps-discuss@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 53C361A6FD5 for <apps-discuss@ietfa.amsl.com>; Thu, 8 Jan 2015 07:07:52 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -2.602
X-Spam-Level:
X-Spam-Status: No, score=-2.602 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001] autolearn=ham
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 LnXU-otyN_zQ for <apps-discuss@ietfa.amsl.com>; Thu, 8 Jan 2015 07:07:50 -0800 (PST)
Received: from mxout-08.mxes.net (mxout-08.mxes.net [216.86.168.183]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D7B8F1A8A5E for <apps-discuss@ietf.org>; Thu, 8 Jan 2015 07:07:49 -0800 (PST)
Received: from [192.168.158.75] (unknown [104.132.4.108]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.mxes.net (Postfix) with ESMTPSA id D5608509BB; Thu, 8 Jan 2015 10:07:48 -0500 (EST)
Content-Type: text/plain; charset="utf-8"
Mime-Version: 1.0 (Mac OS X Mail 8.1 \(1993\))
From: Mark Nottingham <mnot@mnot.net>
In-Reply-To: <CACweHNBVOrVMesB7HOjPNHe5FtzL1k9XDGAHUXAx5DbOSYv5jA@mail.gmail.com>
Date: Thu, 08 Jan 2015 10:07:48 -0500
Content-Transfer-Encoding: quoted-printable
Message-Id: <A1E5B0EC-FAD5-4178-8C7B-540BEB61DC06@mnot.net>
References: <C5B10293-E6F6-4348-9782-C9C00A4476CE@mnot.net> <CACweHNBVOrVMesB7HOjPNHe5FtzL1k9XDGAHUXAx5DbOSYv5jA@mail.gmail.com>
To: Matthew Kerwin <matthew@kerwin.net.au>
X-Mailer: Apple Mail (2.1993)
Archived-At: <http://mailarchive.ietf.org/arch/msg/apps-discuss/9rzzyilSEh3xKTgNalFRSdXTgHk>
Cc: IETF Apps Discuss <apps-discuss@ietf.org>
Subject: Re: [apps-discuss] Fun with URLs and regex
X-BeenThere: apps-discuss@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: General discussion of application-layer protocols <apps-discuss.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/apps-discuss/>
List-Post: <mailto:apps-discuss@ietf.org>
List-Help: <mailto:apps-discuss-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/apps-discuss>, <mailto:apps-discuss-request@ietf.org?subject=subscribe>
X-List-Received-Date: Thu, 08 Jan 2015 15:07:52 -0000

Fixed, thanks.

I’m hoping to put this into a proper github project soon and refactor it, to make reading it and making contributions easier.

Cheers,


> On 7 Jan 2015, at 6:09 pm, Matthew Kerwin <matthew@kerwin.net.au> wrote:
> 
> On 8 January 2015 at 07:35, Mark Nottingham <mnot@mnot.net> wrote:
> I’ve updated my Python script that serves as a translation of ABNF for URIs into regex.
> 
> https://gist.github.com/mnot/138549
> 
> ​[...]​​​
> ​​
> 
> This is very cool. I'm definitely going to use it to help me retool the file ABNF. Thanks.
> 
> 
> ​​Would the respective communities review the regex to make sure they’re faithful (except for the caveat around quoted strings)?
> 
> 
> ​Having a look at file:
> 
> #456-458:
> 
> ​| ​# f-auth         = [ userinfo "@" ] host
> ​| ​
> | file_f_auth = r"(?: %(userinfo)s @ %(host)s )" % locals()
> 
> Shouldn't there be a `()?` around userinfo@​ ?
> 
> ​Cheers
> -- 
>   Matthew Kerwin
>   http://matthew.kerwin.net.au/
> _______________________________________________
> apps-discuss mailing list
> apps-discuss@ietf.org
> https://www.ietf.org/mailman/listinfo/apps-discuss

--
Mark Nottingham   http://www.mnot.net/