From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17255 invoked from network); 3 Nov 1998 08:19:42 -0000 Received: from math.gatech.edu (list@130.207.146.50) by ns1.primenet.com.au with SMTP; 3 Nov 1998 08:19:42 -0000 Received: (from list@localhost) by math.gatech.edu (8.9.1/8.9.1) id DAA13199; Tue, 3 Nov 1998 03:14:28 -0500 (EST) Resent-Date: Tue, 3 Nov 1998 03:14:28 -0500 (EST) Date: Tue, 3 Nov 1998 09:12:29 +0100 (MET) Message-Id: <199811030812.JAA23176@beta.informatik.hu-berlin.de> From: Sven Wischnowsky To: zsh-workers@math.gatech.edu In-reply-to: Bruce Stephens's message of 02 Nov 1998 17:45:39 +0000 Subject: Re: PATCH: 3.1.5 - (Sven) Case-insensitive globbing Resent-Message-ID: <"T9mTK2.0.7E3.ajhFs"@math> Resent-From: zsh-workers@math.gatech.edu X-Mailing-List: archive/latest/4508 X-Loop: zsh-workers@math.gatech.edu Precedence: list Resent-Sender: zsh-workers-request@math.gatech.edu Bruce Stephens wrote: > > 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. I completely agree, there is a whole new set of globbing options on the horizon ;-) About the `options for the whole path' thing (which I would like to have, too): why not use a generic approach, like the `^' and `-' glob modifiers, i.e. `(#i)' works on the current path component, probably only up to the next `(#...)' and `(#/i)' works on this and all following components (until switched off again). Bye Sven -- Sven Wischnowsky wischnow@informatik.hu-berlin.de