From owner-freebsd-hackers@freebsd.org Thu Nov 5 03:36:25 2015 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 8B922A257CF for ; Thu, 5 Nov 2015 03:36:25 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from udns.ultimatedns.net (unknown [IPv6:2602:d1:b4d6:e600:4261:86ff:fef6:aa2a]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4E2361F28 for ; Thu, 5 Nov 2015 03:36:25 +0000 (UTC) (envelope-from bsd-lists@bsdforge.com) Received: from ultimatedns.net (localhost [127.0.0.1]) by udns.ultimatedns.net (8.14.9/8.14.9) with ESMTP id tA53aNOj020179 for ; Wed, 4 Nov 2015 19:36:29 -0800 (PST) (envelope-from bsd-lists@bsdforge.com) To: In-Reply-To: <1446670398.91534.358.camel@freebsd.org> References: <20151104211008.00006c16@gmail.com>, <1446670398.91534.358.camel@freebsd.org> From: "Chris H" Subject: Re: awk's curly braces (regex) Date: Wed, 04 Nov 2015 19:36:29 -0800 Content-Type: text/plain; charset=UTF-8; format=fixed MIME-Version: 1.0 Message-id: <3605b86a5de658159efd2e014a75b0e1@ultimatedns.net> Content-Transfer-Encoding: 8bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2015 03:36:25 -0000 On Wed, 04 Nov 2015 13:53:18 -0700 Ian Lepore wrote > On Wed, 2015-11-04 at 21:10 +0100, rank1seeker@gmail.com wrote: > > 10.2-RELEASE-p6 > > > > # awk --version > > awk version 20121220 (FreeBSD) > > > > # echo 2015 | awk '/^[0-9]/ {print}' > > Prints '2015' > > > > # echo 2015 | awk '/^[0-9]{4}/ {print}' > > Won't > > > > Why range/interval specified via curly braces doesn't work. > > PS: Yes I've tried escaping it with backslahes and double backslahes, > > nada! > > > > man pages: > > -- > > Regular expressions are as in egrep; see grep(1). > > -- Your SHELL can be a "gatcha", as well. > > For what it's worth, the manpage on a linux system I checked also says > the regex is like egrep, but then it points out that one difference is > "interval expressions" (curly brace stuff) which it says are "likely to > break old awk programs" so they're only enabled if --posix or --re > -interval options are given. Our awk doesn't seem to support those > options. > > I guess our awk might also avoid the interval expressions out of > caution for breaking old programs; maybe we need to add the options to > enable them, like gnu awk has. > > -- Ian > > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"