From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17004 invoked from network); 9 Aug 1999 06:25:35 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 9 Aug 1999 06:25:34 -0000 Received: (qmail 12487 invoked by alias); 9 Aug 1999 06:25:22 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7399 Received: (qmail 12480 invoked from network); 9 Aug 1999 06:25:22 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer thoth.mch.sni.de) From: "Andrej Borsenkow" To: "Bart Schaefer" , "Zsh hackers list" Subject: RE: Extended glob patterns in ${...#..} RE: Un-patch: new pattern matching code Date: Mon, 9 Aug 1999 10:25:15 +0400 Message-ID: <000901bee22f$f13b05b0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <990809042534.ZM25662@candle.brasslantern.com> Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 > 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> > Believe it or not, it does work today. I have no idea, what went wrong yesterday (I thought, it was the problem of flag order ...): bor@itsrm2:~%> foo=ab12xy bor@itsrm2:~%> print ${(SM)foo##[[:digit:]]#} 12 bor@itsrm2:~%> print ${(MS)foo##[[:digit:]]#} 12 But still, this one is probably unexpected: bor@itsrm2:~%> print ${(MSI:1:)foo##[[:digit:]]#} 12 bor@itsrm2:~%> print ${(MSI:2:)foo##[[:digit:]]#} 2 bor@itsrm2:~%> print ${(MSI:3:)foo##[[:digit:]]#} The first is O.K. ... and the third is O.K., but the second? I believe, this is a clear bug. The ``S'' flag must consider only non-overlapped matches (the same way, sed works). /andrej