From owner-freebsd-current Tue Feb 20 19:38:32 2001 Delivered-To: freebsd-current@freebsd.org Received: from peach.ocn.ne.jp (peach.ocn.ne.jp [210.145.254.87]) by hub.freebsd.org (Postfix) with ESMTP id 503F237B491 for ; Tue, 20 Feb 2001 19:38:28 -0800 (PST) (envelope-from dcs@newsguy.com) Received: from newsguy.com (p06-dn02kiryunisiki.gunma.ocn.ne.jp [211.0.245.71]) by peach.ocn.ne.jp (8.9.1a/OCN/) with ESMTP id MAA13745; Wed, 21 Feb 2001 12:37:56 +0900 (JST) Message-ID: <3A93376D.B371FCD1@newsguy.com> Date: Wed, 21 Feb 2001 12:35:09 +0900 From: "Daniel C. Sobral" X-Mailer: Mozilla 4.7 [en] (Win98; I) X-Accept-Language: en,pt-BR MIME-Version: 1.0 To: Akinori MUSHA , current@freebsd.org Subject: Re: find(1) -regex/-iregex References: <8666i588p4.wl@archon.local.idaemons.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Akinori MUSHA wrote: > > Hi, > > I have implemented -regex and -iregex options for find(1): > > http://people.FreeBSD.org/~knu/misc/find_regex.diff I'm not familiar with find sources, but it seems to me you execute regcomp() for each file name to be compared? If so... change that! :-) Regcomp() does expensive setup so that regexec() can be run inexpensively many times over. > They are meant to be compatible with those of GNU's and NetBSD's: > > -regex : > > True if the whole path of the file matches using > basic regular expression. To match a file named > ``./foo/xyzzy'', you can use the regular expression > ``.*/[xyz]*'' or ``.*/foo/.*'', but not ``xyzzy'' or > ``/foo/''. > > -iregex : > > Like -regex, but the match is case insensitive. You forgot -E (use extended regexp syntax), and the example you show above is extended regexp syntax, not basic regexp syntax. > I'd like to commit it after reviews if there is no convincing > objection against it. Any suggestion is welcome. Well, I expressed my concerns above. -- Daniel C. Sobral (8-DCS) dcs@newsguy.com dcs@freebsd.org capo@the.fashionable.bsdconspiracy.net "Too bad sentience isn't a marketable commodity." To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message