From owner-freebsd-questions@freebsd.org Tue Jul 12 17:36:37 2016 Return-Path: Delivered-To: freebsd-questions@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 15924B84A41 for ; Tue, 12 Jul 2016 17:36:37 +0000 (UTC) (envelope-from me@danieldk.eu) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D2DC71E46; Tue, 12 Jul 2016 17:36:36 +0000 (UTC) (envelope-from me@danieldk.eu) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 015E2206F4; Tue, 12 Jul 2016 13:36:34 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute6.internal (MEProxy); Tue, 12 Jul 2016 13:36:35 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=danieldk.eu; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=mesmtp; bh=6HvVcSrqQcwaf7r68Yq3y8CNNkM=; b=zaGJ+0 wm+TPIMJpV5hg64Tf2jr0+D4MnnSqwlq9yXRgXM3S1L14ACFEGBemz9qVTPfz9sb ejjzx9mHWZU0eeUAPxwiLlBKz5Y22uR76PFkhOCPwc+TosZ5QEQ/Ad7yJ6988raC dey8x+C4OesNK9l5z3tWvZRqi8Y2BIiPyDXHg= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=6HvVcSrqQcwaf7r 68Yq3y8CNNkM=; b=EisUFb66uWmPNxF201SLuX50gBI1K6T53KbVxqLFN4JbZ95 N84/ab3xBn0SUsgQomgNmg45DFWSv2iItM/nUgEL+LYubKvbe/hfyPUyMBakHObD y2t5yRwMTFiptqYBQJyIe2MntqaWNkSscJazkIdRwNaFZdPGsv/9D31nPEQw= X-Sasl-enc: +du1R6QwzoAO/2sikzH6dGqlO4y4zHRc0ITFKTtD/PRo 1468344994 Received: from localhost (hsi-kbw-046-005-018-048.hsi8.kabel-badenwuerttemberg.de [46.5.18.48]) by mail.messagingengine.com (Postfix) with ESMTPA id 6D658CCDB8; Tue, 12 Jul 2016 13:36:34 -0400 (EDT) Date: Tue, 12 Jul 2016 19:36:36 +0200 From: =?iso-8859-1?Q?Dani=EBl?= de Kok To: Matthew Seaman Cc: freebsd-questions@freebsd.org Subject: Re: grep and anchoring Message-ID: <20160712173623.7fu7orda2gozh2pe@Daniels-MacBook.local> References: <20232C89-B821-41EC-9188-C2A19C679BD8@danieldk.eu> <20160626163411.d05f863e.freebsd@edvax.de> <362EE01F-4B49-4ADB-A3A6-43F852FFF87F@danieldk.eu> <9fc6d5df-108b-5663-5a31-92ca915a9604@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <9fc6d5df-108b-5663-5a31-92ca915a9604@FreeBSD.org> User-Agent: Mutt/1.6.1-neo (2016-06-11) X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Jul 2016 17:36:37 -0000 On Sun, Jun 26, 2016 at 04:31:20PM +0100, Matthew Seaman wrote: > You are completely correct -- this is a bug in grep(1) on FreeBSD. In > all current releases including the upcoming 11.0-RELEASE grep is > actually GNU grep version 2.1.5. However, the same bug occurs in > bsdgrep(1): > > % echo 1234 1234 1234 | bsdgrep -o '^....' > 1234 > 123 > 4 12 > > There is already an open PR about a very similar issue: > > https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=201650 FWIW, I took some time to look at the bsdgrep issue tonight and have attached a fix to the PR above. With kind regards, Daniël de Kok