From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6409 invoked from network); 8 Aug 1999 10:04:45 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 8 Aug 1999 10:04:45 -0000 Received: (qmail 15626 invoked by alias); 8 Aug 1999 10:04:34 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7397 Received: (qmail 15619 invoked from network); 8 Aug 1999 10:04:33 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer david.siemens.de) From: "Andrej Borsenkow" To: "Bart Schaefer" , "Zsh hackers list" Subject: Extended glob patterns in ${...#..} RE: Un-patch: new pattern matching code Date: Sun, 8 Aug 1999 14:04:29 +0400 Message-ID: <001101bee185$67ad4060$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: <990807174848.ZM19657@candle.brasslantern.com> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Importance: Normal > > } I am not sure, that there is easy > } way in Zsh to extract matched subpattern currently) > > 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:~%> foo=ab12xy bor@itsrm2:~%> print ${(SM)foo#[[:digit:]]} 1 bor@itsrm2:~%> print ${(SM)foo#([[:digit:]])#} And some more considerations: there is subtle problem: searching for "...sub1 ...sub2..." may give different results as searching for sub1 first and then for sub2 the exact order number of desired match is not always available. So, the above example is not exact replacement for submatches reference. Granted, Zsh lived without it for a long time - but, if we have this now, why not use it? /andrej