From owner-freebsd-bugs@FreeBSD.ORG Thu Apr 12 15:14:09 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 49863106566B for ; Thu, 12 Apr 2012 15:14:09 +0000 (UTC) (envelope-from johnandsara2@cox.net) Received: from eastrmfepo201.cox.net (eastrmfepo201.cox.net [68.230.241.216]) by mx1.freebsd.org (Postfix) with ESMTP id DBB008FC16 for ; Thu, 12 Apr 2012 15:14:08 +0000 (UTC) Received: from eastrmimpo110.cox.net ([68.230.241.223]) by eastrmfepo201.cox.net (InterMail vM.8.01.04.00 201-2260-137-20101110) with ESMTP id <20120412151408.ONPX5450.eastrmfepo201.cox.net@eastrmimpo110.cox.net>; Thu, 12 Apr 2012 11:14:08 -0400 Received: from [192.168.3.22] ([70.177.172.35]) by eastrmimpo110.cox.net with bizsmtp id x3E71i00B0mAvba023E7Uf; Thu, 12 Apr 2012 11:14:08 -0400 X-CT-Class: Clean X-CT-Score: 0.00 X-CT-RefID: str=0001.0A02020A.4F86F140.0023,ss=1,re=0.000,fgs=0 X-CT-Spam: 0 X-Authority-Analysis: v=1.1 cv=9p1evl5cAK1ZYNWAcfn8X6IfAmCGuOPdFgneQpdUexw= c=1 sm=1 a=f5xKl4ys9bwA:10 a=WqOOypwpByUA:10 a=G8Uczd0VNMoA:10 a=Wajolswj7cQA:10 a=8nJEP1OIZ-IA:10 a=alU6Bxxa4qBWIf+k8j/ISQ==:17 a=pGLkceISAAAA:8 a=Q84so9DhaFPdehuReQ0A:9 a=m9-9HRJtwZi349avNVQA:7 a=wPNLvfGTeEIA:10 a=MSl-tDqOz04A:10 a=alU6Bxxa4qBWIf+k8j/ISQ==:117 X-CM-Score: 0.00 Authentication-Results: cox.net; none Message-ID: <4F86F142.2010401@cox.net> Date: Thu, 12 Apr 2012 11:14:10 -0400 From: "John D. Hendrickson and Sara Darnell" User-Agent: Thunderbird 2.0.0.24 (X11/20100228) MIME-Version: 1.0 To: Jim Pryor References: <201204120410.q3C4ACqg071289@freefall.freebsd.org> In-Reply-To: <201204120410.q3C4ACqg071289@freefall.freebsd.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 Reply-To: johnandsara2@cox.net List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Apr 2012 15:14:09 -0000 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