From owner-freebsd-current@FreeBSD.ORG Thu Sep 24 11:36:28 2009 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 4BCD61065676 for ; Thu, 24 Sep 2009 11:36:28 +0000 (UTC) (envelope-from des@des.no) Received: from tim.des.no (tim.des.no [194.63.250.121]) by mx1.freebsd.org (Postfix) with ESMTP id 0F2128FC17 for ; Thu, 24 Sep 2009 11:36:27 +0000 (UTC) Received: from ds4.des.no (des.no [84.49.246.2]) by smtp.des.no (Postfix) with ESMTP id 3AF9F6D44C; Thu, 24 Sep 2009 11:36:27 +0000 (UTC) Received: by ds4.des.no (Postfix, from userid 1001) id 1AA55844A2; Thu, 24 Sep 2009 13:36:27 +0200 (CEST) From: =?utf-8?Q?Dag-Erling_Sm=C3=B8rgrav?= To: grarpamp References: Date: Thu, 24 Sep 2009 13:36:26 +0200 In-Reply-To: (grarpamp@gmail.com's message of "Thu, 24 Sep 2009 01:32:25 -0400") Message-ID: <868wg460ck.fsf@ds4.des.no> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.95 (berkeley-unix) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current@freebsd.org Subject: Re: regex lint 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: Thu, 24 Sep 2009 11:36:28 -0000 grarpamp writes: > The first one is fine, the second one complains. > Aren't these both backed by the same regex lib? No, grep(1) uses the GNU regex library, while find(1) uses the one from libc (which, among other shortcomings, is not localized). > I prefer the former as allowing empty subexpressions saves a ton of > space on the command line by not requiring the enumeration of the > expansion. I'm not sure I understand what you mean by "enumeration of the expansion"; /(foo|)/ is equivalent to /(foo)?/, which is exactly the same length. DES --=20 Dag-Erling Sm=C3=B8rgrav - des@des.no