From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15355 invoked from network); 9 Aug 1999 04:25:50 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Aug 1999 04:25:50 -0000 Received: (qmail 25639 invoked by alias); 9 Aug 1999 04:25:40 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7398 Received: (qmail 25632 invoked from network); 9 Aug 1999 04:25:39 -0000 From: "Bart Schaefer" Message-Id: <990809042534.ZM25662@candle.brasslantern.com> Date: Mon, 9 Aug 1999 04:25:34 +0000 In-Reply-To: <001101bee185$67ad4060$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "Extended glob patterns in ${...#..} RE: Un-patch: new pattern matching code" (Aug 8, 2:04pm) References: <001101bee185$67ad4060$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "Zsh hackers list" Subject: Re: Extended glob patterns in ${...#..} RE: Un-patch: new pattern matching code MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 8, 2:04pm, Andrej Borsenkow wrote: } Subject: Extended glob patterns in ${...#..} RE: Un-patch: new pattern mat } } > There is ${(MSI:n:)...#...}, where n is a number. } } It looks, like this does not work with extended glob patterns (3.1.6 pure or } pws-1): } } bor@itsrm2:~%> print ${(SM)foo#([[:digit:]])#} This is at least partly consistent: zagzig<7> foo=ab12xy zagzig<8> print ${(SM)foo#*} zagzig<9> Since a closure can match the empty string, the shortest matched portion is nothing. However, asking for the longest match definitely doesn't work: zagzig<9> print ${(SM)foo##*} ab12xy zagzig<10> print ${(SM)foo##([[:digit:]])#} zagzig<11> } there is subtle problem: searching for "...sub1 ...sub2..." may give } different results as searching for sub1 first and then for sub2 True. -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com