Re: [DNSOP] Microphone question on back-references - BULK RR

"Woodworth, John R" <> Fri, 31 March 2017 07:20 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id 85151127B31 for <>; Fri, 31 Mar 2017 00:20:49 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id 0ItqsXVGg-Nd for <>; Fri, 31 Mar 2017 00:20:47 -0700 (PDT)
Received: from ( []) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by (Postfix) with ESMTPS id 8297E1293DB for <>; Fri, 31 Mar 2017 00:20:47 -0700 (PDT)
Received: from lxdnp04n.corp.intranet (lxdnp04n.corp.intranet []) by (8.14.8/8.14.8) with ESMTP id v2V7Kkgo013827 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Mar 2017 01:20:46 -0600
Received: from lxdnp04n.corp.intranet (localhost []) by lxdnp04n.corp.intranet (8.14.8/8.14.8) with ESMTP id v2V7KeAO038576; Fri, 31 Mar 2017 01:20:40 -0600
Received: from lxomp07u.corp.intranet (lxdnp23m.corp.intranet []) by lxdnp04n.corp.intranet (8.14.8/8.14.8) with ESMTP id v2V7Kejn038350 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=NO); Fri, 31 Mar 2017 01:20:40 -0600
Received: from lxomp07u.corp.intranet (localhost []) by lxomp07u.corp.intranet (8.14.8/8.14.8) with ESMTP id v2V7Ketf053545; Fri, 31 Mar 2017 02:20:40 -0500
Received: from vodcwhubex502.ctl.intranet (vodcwhubex502.ctl.intranet []) by lxomp07u.corp.intranet (8.14.8/8.14.8) with ESMTP id v2V7KelL053542 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=FAIL); Fri, 31 Mar 2017 02:20:40 -0500
Received: from PODCWMBXEX501.ctl.intranet ([]) by vodcwhubex502.ctl.intranet ([]) with mapi id 14.03.0339.000; Fri, 31 Mar 2017 02:20:40 -0500
From: "Woodworth, John R" <>
To: 'Brian Dickson' <>, " WG" <>
CC: 'JW' <>, "Woodworth, John R" <>
Thread-Topic: [DNSOP] Microphone question on back-references - BULK RR
Thread-Index: AQHSqbLxZh3GxvcKkk+xKwofOOQn4qGudyxA
Date: Fri, 31 Mar 2017 07:20:39 +0000
Message-ID: <A05B583C828C614EBAD1DA920D92866BD0733FF9@PODCWMBXEX501.ctl.intranet>
References: <>
In-Reply-To: <>
Accept-Language: en-US
Content-Language: en-US
x-originating-ip: []
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
MIME-Version: 1.0
X-TM-AS-MML: disable
X-CFilter-Loop: Reflected
Archived-At: <>
Subject: Re: [DNSOP] Microphone question on back-references - BULK RR
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: IETF DNSOP WG mailing list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Fri, 31 Mar 2017 07:20:50 -0000

> From: DNSOP [] On Behalf Of Brian Dickson
> > Apologies but I did not hear the full question regarding BULK RR’s
> > and the perl like back-references.  If you could please repeat
> > the question we would be happy to comment.
> >
> >
> > Thanks,
> > John
> >
> Sorry for the delayed response.

Hi Brian,

Thank you so much for following up!

> The question was:
> Given the use of perl-style back-references ( like "${1}" ) - would
> it not make sense to use the same perl syntax to provide
> well-defined targets for those back-references?
> E.g. "my-special-(<regex-thing>)-(<regex-thing>)-with-suffix" and
> then there is no ambiguity as to what ${1} and ${2} point at?
> Perl regex rules are IMHO very clean and clever, and avoid ambiguity
> very nicely.
> (Also historical shout-out to Henry Spencer, whose regex mods served
> as the source for perl's.)

Full disclosure:

   I especially love the perl-regex rule engine and can't imagine doing
   even half the things I have to do every day without it.

   I echo your thanks to Mr. Spencer and include the authors of libpcre
   who's dedication has allowed me to easily use the perl-regex ruleset
   for my every whim.

In fact, when we first set out to solve our problem, regex was our
instinctual go-to.  Unfortunately, it soon became clear regex is
simply _too_ complicated for the task at hand.

First, in our case the patterns will _always_ be numeric ranges
(or sets of ranges) and regex, no matter the flavor, simply brings
too much baggage (i.e. overhead) to the party.

Second, regex was designed for string/ substring pattern matching
and is simply horrible at multi-digit numeric ranges
(the one thing we need it for).

Try out this example:

We want to match a numeric range from 0-255.

With PCRE, this becomes:


With BULK-RR, this becomes:


Now, lets take a slightly more complicated example.  Say we have
an IPv4 /16 broken into 4 /18's.

Depending on which /18 is being targeted, the third octet can be
within the ranges: 0-63, 64-127, 128-191 or 192-255.

[0-63]    vs. (0|[1-5][0-9]|6[0-3])
[64-127]  vs. (6[4-9]|[789][0-9]|1[01][0-9]|12[0-7])
[128-191] vs. ???
[192-255] vs. ???

Even if you are an absolute regex genius and this poses zero
challenge, in situation like this I often ask myself:

  -  Which would you rather figure out in the middle of the night?
  -  Would I like to be woken up for this or should it be easier
     for 'someone else'?

> Things inside parentheses are the target of back-refs.
> In Perl, there is no need to escape the parentheses within regexes.

The square brackets can only contain numeric ranges (or sets of ranges)
so no need to escape within them either.

Thanks again,

NOTE: The regex pattern for 0-255 was borrowed from a quick web
      search (link below).

> Brian
This communication is the property of CenturyLink and may contain confidential or privileged information. Unauthorized use of this communication is strictly prohibited and may be unlawful. If you have received this communication in error, please immediately notify the sender by reply e-mail and destroy all copies of the communication and any attachments.