From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29987 invoked from network); 7 Aug 1999 17:49:06 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 7 Aug 1999 17:49:06 -0000 Received: (qmail 5698 invoked by alias); 7 Aug 1999 17:48:54 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7395 Received: (qmail 5690 invoked from network); 7 Aug 1999 17:48:53 -0000 From: "Bart Schaefer" Message-Id: <990807174848.ZM19657@candle.brasslantern.com> Date: Sat, 7 Aug 1999 17:48:48 +0000 In-Reply-To: <000001bee0b3$8c181970$21c9ca95@mow.siemens.ru> Comments: In reply to "Andrej Borsenkow" "RE: Un-patch: new pattern matching code" (Aug 7, 1:02pm) References: <000001bee0b3$8c181970$21c9ca95@mow.siemens.ru> X-Mailer: Z-Mail (5.0.0 30July97) To: "Zsh hackers list" Subject: Re: Un-patch: new pattern matching code MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii On Aug 7, 1:02pm, Andrej Borsenkow wrote: } Subject: RE: Un-patch: new pattern matching code } } > } > The other cpp definition is BACKREFERENCES } } If e.g. the result of last pattern mathing is } available (much like in Perl) as, say, ``pattern'' array I'd name it something other than `pattern' ... what's in the array is not the patterns, it's the matched substring of the source string, right? } 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. BTW, it looks like (M) doesn't work right with ${.../...}. Am I missing something? zagzig% x="abcdefghij" zagzig% echo ${x/??} cdefghij zagzig% echo ${(M)x/??} cdefghij zagzig% echo ${(MS)x/??} cdefghij zagzig% echo ${(MSI:1:)x/??} cdefghij zagzig% echo ${(MSI:2:)x/??} adefghij zagzig% echo ${(RSI:2:)x/??} adefghij echo ${(MSI:2:)x//??} ab zagzig% echo ${(M)x#??} ab zagzig% echo ${(MSI:2:)x#??} bc -- Bart Schaefer Brass Lantern Enterprises http://www.well.com/user/barts http://www.brasslantern.com