From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4399 invoked from network); 2 Nov 1998 17:54:22 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 2 Nov 1998 17:54:22 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id MAA22431; Mon, 2 Nov 1998 12:47:49 -0500 (EST) Resent-Date: Mon, 2 Nov 1998 12:47:49 -0500 (EST) Sender: B.Stephens@isode.com To: zsh-workers@math.gatech.edu (Zsh hackers list) Subject: Re: PATCH: 3.1.5 - (Sven) Case-insensitive globbing References: <9811021707.AA24379@ibmth.df.unipi.it> Mime-Version: 1.0 (generated by tm-edit 7.108) Content-Type: text/plain; charset=US-ASCII From: Bruce Stephens Date: 02 Nov 1998 17:45:39 +0000 In-Reply-To: Peter Stephenson's message of "Mon, 02 Nov 1998 18:07:41 +0100" Message-ID: X-Mailer: Gnus v5.6.27/XEmacs 20.4 - "Emerald" Resent-Message-ID: <"nnNkg2.0.QU5.51VFs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4505 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Peter Stephenson writes: > This doesn't clash with any existing syntax. Obviously you need > EXTENDED_GLOB set. > > Syntax 1 Syntax 2 > (#ifoo)bar ((#i)foo)bar match FOObar FoObar fOobar, not FOOBAR > bar(#ifoo) bar(#i)foo same with the bits the other way round > (#lfooBAR) (#l)fooBAR match FOOBAR FoOBAR fOoBAR, not foobar > (#ifoo(#cbar)) (#i)foo(#c)bar same as first example; #c negates i or l > > So in the first case, only the #X is the flag and grouping is normal, > while in the second case the whole of (#X) is the flag and doesn't > mark a separate group. In both cases the effect stays until the end > of the nearest enclosing group. > > #s (for significant) could be an alternative to #c; #l corresponds to > Sven's (f) qualifier, i.e. only lower case letters in the pattern > match case-insensitively in the target string. > > I think I find the second version (which is also more perl-like) a > bit cleaner. I prefer the second versions too. What would really make it compelling, of course, would be other flags that you might want to use (when the first syntax could get tricky and ambiguous). I can only think of one candidate at present: ignore dots. #d, say. Then, a single pattern could match README, READ.ME, Read.Me and so on: (#di)readme. But my example is strained, I don't really suggest that it would be a good idea.