From owner-freebsd-current@FreeBSD.ORG Mon Aug 23 12:45:43 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 01F151065673 for ; Mon, 23 Aug 2010 12:45:43 +0000 (UTC) (envelope-from rb@gid.co.uk) Received: from mx0.gid.co.uk (mx0.gid.co.uk [194.32.164.250]) by mx1.freebsd.org (Postfix) with ESMTP id 97CD58FC18 for ; Mon, 23 Aug 2010 12:45:42 +0000 (UTC) Received: from gidgate.gid.co.uk (80-46-130-69.static.dsl.as9105.com [80.46.130.69]) by mx0.gid.co.uk (8.14.2/8.14.2) with ESMTP id o7NCjcTs046356; Mon, 23 Aug 2010 13:45:38 +0100 (BST) (envelope-from rb@gid.co.uk) Received: from [192.168.2.3] (host86-153-254-17.range86-153.btcentralplus.com [86.153.254.17]) by gidgate.gid.co.uk (8.13.8/8.13.8) with ESMTP id o7NCjWJQ089222; Mon, 23 Aug 2010 13:45:32 +0100 (BST) (envelope-from rb@gid.co.uk) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Bob Bishop In-Reply-To: <4C7260CC.9070407@list.mightyreason.com> Date: Mon, 23 Aug 2010 13:45:26 +0100 Content-Transfer-Encoding: 7bit Message-Id: <1179D92F-9AB7-43A4-8943-7DA58F5E234D@gid.co.uk> References: <4C7260CC.9070407@list.mightyreason.com> To: chrisk-freebsd@list.mightyreason.com X-Mailer: Apple Mail (2.1081) Cc: freebsd-current@freebsd.org, gabor@freebsd.org Subject: Re: grep and Regular expression correctness X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Aug 2010 12:45:43 -0000 Hi, On 23 Aug 2010, at 12:51, chrisk-freebsd@list.mightyreason.com wrote: > [...]The hardest part of POSIX regular expressions is in picking out the > correct captured subexpressions. This makes programs like "sed" > vulnerable to the bad regex.h engine that comes with the operating system. > > Luckily grep does not need the captured subexpressions, and thus does > not need the complexity that comes from the ideas behind TRE. [etc] I think grep does potentially need the captured subexpressions, for eg: \([abc]\)99\1 matching eg b99b -- Bob Bishop rb@gid.co.uk