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

Matthew Kerwin <matthew@kerwin.net.au> Wed, 07 January 2015 23:11 UTC

Return-Path: <phluid61@gmail.com>
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 A8DFA1A7001 for <apps-discuss@ietfa.amsl.com>; Wed, 7 Jan 2015 15:11:23 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.027
X-Spam-Level:
X-Spam-Status: No, score=-1.027 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FM_FORGED_GMAIL=0.622, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, SPF_PASS=-0.001] autolearn=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 IwF1R-buVZdJ for <apps-discuss@ietfa.amsl.com>; Wed, 7 Jan 2015 15:11:22 -0800 (PST)
Received: from mail-qc0-x229.google.com (mail-qc0-x229.google.com [IPv6:2607:f8b0:400d:c01::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 3758E1A6FFD for <apps-discuss@ietf.org>; Wed, 7 Jan 2015 15:09:52 -0800 (PST)
Received: by mail-qc0-f169.google.com with SMTP id w7so1681392qcr.28 for <apps-discuss@ietf.org>; Wed, 07 Jan 2015 15:09:51 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=gQmYLURvcNDduz5Atd83y0BP3yFzdkptQhmlaXrwEHY=; b=wPP62prJ+qohHcXIFRpK/Hmylyf+dcLPdZ12jAjjIykFIgQGF9KNYxLAr3wYOixPGp 0v4l+nZFAjkg9Zjym+wk4p1XGvWrnH9nyVo22/FkgoA+cymDMPCFQG/bHoHG9Hf8TLdF 51XprvYiLBQFL+kjSeAtKoVfpGTVV3xb48l2qi0xgqIa44KMCSDBXB8sxJG8KHq18riN syIDlIYsI916h3cX7uXUl0zbEjJlERPRW3hXmeqaCRSJAclO2GD64QQ1GEZsbPzN2FM3 Kpo9GSiAEibhiqB8BRR/Q2li5F4AAKF0kiYkVFzOpTUOpwALpe2FmPA4buJ5jKTJkmGV GYjA==
MIME-Version: 1.0
X-Received: by 10.140.19.139 with SMTP id 11mr9071656qgh.14.1420672191415; Wed, 07 Jan 2015 15:09:51 -0800 (PST)
Sender: phluid61@gmail.com
Received: by 10.140.93.98 with HTTP; Wed, 7 Jan 2015 15:09:51 -0800 (PST)
In-Reply-To: <C5B10293-E6F6-4348-9782-C9C00A4476CE@mnot.net>
References: <C5B10293-E6F6-4348-9782-C9C00A4476CE@mnot.net>
Date: Thu, 08 Jan 2015 09:09:51 +1000
X-Google-Sender-Auth: y47Vy3jvk5NdoO4bIQ148wuySek
Message-ID: <CACweHNBVOrVMesB7HOjPNHe5FtzL1k9XDGAHUXAx5DbOSYv5jA@mail.gmail.com>
From: Matthew Kerwin <matthew@kerwin.net.au>
To: Mark Nottingham <mnot@mnot.net>
Content-Type: multipart/alternative; boundary="001a1134f03c4fcadd050c18050a"
Archived-At: http://mailarchive.ietf.org/arch/msg/apps-discuss/rVtiuBN1p2wieOSw4QWSjD2bwM8
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: Wed, 07 Jan 2015 23:11:23 -0000

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/