From owner-freebsd-current@FreeBSD.ORG Fri Jun 12 13:35:17 2015 Return-Path: Delivered-To: freebsd-current@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD938741 for ; Fri, 12 Jun 2015 13:35:17 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 04B961B35 for ; Fri, 12 Jun 2015 13:35:16 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id QAA25239 for ; Fri, 12 Jun 2015 16:35:14 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1Z3P73-0003x4-As for freebsd-current@FreeBSD.org; Fri, 12 Jun 2015 16:35:13 +0300 Message-ID: <557ADFD8.50001@FreeBSD.org> Date: Fri, 12 Jun 2015 16:34:16 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: FreeBSD Current Subject: Re: bug with special bracket expressions in regular expressions References: <5224A693.3000904@FreeBSD.org> <5224C08E.1070404@FreeBSD.org> In-Reply-To: <5224C08E.1070404@FreeBSD.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.20 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: Fri, 12 Jun 2015 13:35:17 -0000 On 02/09/2013 19:45, Andriy Gapon wrote: > It seems that the code works like this: > - first it matches "cd0 " and "removes" it > - then it passes "cd1 xx" for matching with a flag that tells that this is not > a real start of the string > - thus the matching code > o knows that this is not a real line start, so it can't match [[:<:]] > just for that reason > o it does _not_ know what was the character before the start of the given > substring, so it can not know if it could match [[:<:]] > > So matching fails. > Not sure if this is an internal problem of regex(3) or a problem of how sed(1) > uses regex(3). I've come up with a patch to fix this problem: https://reviews.freebsd.org/D2792 I am not sure who among the developers is interested in the regexp code, so currently the request does not have any reviewers. If know that code well or care about its correctness please add yourself ti the review request. All testers are welcome. The issue could be quite an edge case, but I am more interested to see if no regressions are introduced. Thanks. -- Andriy Gapon