From owner-freebsd-bugs@FreeBSD.ORG Thu Apr 12 15:37:05 2012 Return-Path: Delivered-To: freebsd-bugs@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 85B52106564A for ; Thu, 12 Apr 2012 15:37:05 +0000 (UTC) (envelope-from dubiousjim@gmail.com) Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by mx1.freebsd.org (Postfix) with ESMTP id 4E9818FC15 for ; Thu, 12 Apr 2012 15:37:05 +0000 (UTC) Received: from compute6.internal (compute6.nyi.mail.srv.osa [10.202.2.46]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id F2AB7207F7 for ; Thu, 12 Apr 2012 11:37:04 -0400 (EDT) Received: from web4.nyi.mail.srv.osa ([10.202.2.214]) by compute6.internal (MEProxy); Thu, 12 Apr 2012 11:37:04 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=message-id:from:to:cc:mime-version :content-transfer-encoding:content-type:subject:date:in-reply-to :references; s=smtpout; bh=RTNW3hgKYDn/NWqfbgYISy6z8AE=; b=GIDrZ n3Gek8+UswFbmMeU4/n/yXT8b1CMpDTNECRTyCDQRGFmgn/HrOZRNUGql11fp4oj 55J6Eh4WgjSXtzUkdesYztl8LKJjSFocYbl1qChcpHDjk0/MFKeoTNG9wZWDXB6/ k+cU49Tg4SCrUP7EmLl+BRrRqmayilzr7xwIHU= Received: by web4.nyi.mail.srv.osa (Postfix, from userid 99) id CF42F3C1EAD; Thu, 12 Apr 2012 11:37:04 -0400 (EDT) Message-Id: <1334245024.11829.140661061535169.6EEC2FD8@webmail.messagingengine.com> X-Sasl-Enc: UYqzaSozhInwUHBIYvrjYP1JqtFGUCJuB24nc+o8bQF6 1334245024 From: Jim Pryor To: "John D. Hendrickson and Sara Darnell" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain X-Mailer: MessagingEngine.com Webmail Interface Date: Thu, 12 Apr 2012 11:37:04 -0400 In-Reply-To: <4F86F142.2010401@cox.net> References: <201204120410.q3C4ACqg071289@freefall.freebsd.org> <4F86F142.2010401@cox.net> Cc: freebsd-bugs@FreeBSD.org Subject: Re: bin/166842: bsdgrep(1) inconsistently handles ^ in non-anchoring positions X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 15:37:05 -0000 On Thu, Apr 12, 2012, at 11:14 AM, John D. Hendrickson and Sara Darnell wrote: > Your problem is incorrect so there is no sol'n. > > printf 'abc def' | grep -o '^[a-z]' > > is only supposed to match against abc. > > see grep(1) about pattern matching - there is plenty of online writeups, > esp posix ieee std. see > also "ant / antlr" for more about patterns and matching. > > Jim Pryor wrote: > > The following reply was made to PR bin/166842; it has been noted by GNATS. > > From: Jim Pryor > > $ printf 'abc def' | grep -o '^[a-z]' > > will match against each of the letters in 'abc', but not against any of > > the letters in 'def'. > > dubiousjim@gmail.com Hi John, I'm sorry I didn't describe the problem adequately to prevent this misunderstanding. $ printf 'abc def' | grep -o '^[a-z]' Expected output: a That is in fact the output I get from Gnu grep. Actual output on FreeBSD: a b c The matches against "b" and "c" are incorrect. -- dubiousjim@gmail.com