From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24242 invoked from network); 9 Jul 2005 06:47:33 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by ns1.primenet.com.au with SMTP; 9 Jul 2005 06:47:33 -0000 Received: (qmail 39411 invoked from network); 9 Jul 2005 06:47:25 -0000 Received: from sunsite.dk (130.225.247.90) by a.mx.sunsite.dk with SMTP; 9 Jul 2005 06:47:25 -0000 Received: (qmail 14278 invoked by alias); 9 Jul 2005 06:47:18 -0000 Mailing-List: contact zsh-users-help@sunsite.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 9066 Received: (qmail 14268 invoked from network); 9 Jul 2005 06:47:17 -0000 Received: from news.dotsrc.org (HELO a.mx.sunsite.dk) (130.225.247.88) by sunsite.dk with SMTP; 9 Jul 2005 06:47:17 -0000 Received: (qmail 38453 invoked from network); 9 Jul 2005 06:47:17 -0000 Received: from mail-ihug.icp-qv1-irony2.iinet.net.au (HELO ihug-mail.icp-qv1-irony2.iinet.net.au) (203.59.1.196) by a.mx.sunsite.dk with SMTP; 9 Jul 2005 06:47:13 -0000 Received: from 203-206-60-250.dyn.iinet.net.au (HELO localhost.localdomain) (203.206.60.250) by ihug-mail.icp-qv1-irony2.iinet.net.au with ESMTP; 09 Jul 2005 14:47:08 +0800 X-BrightmailFiltered: true X-Brightmail-Tracker: AAAAAA== X-IronPort-AV: i="3.93,275,1114963200"; d="scan'208"; a="13500614:sNHT15397992" Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by localhost.localdomain (8.12.8/8.12.8) with ESMTP id j696f4w3007042 for ; Sat, 9 Jul 2005 16:41:05 +1000 Received: (from doug@localhost) by localhost.localdomain (8.12.8/8.12.8/Submit) id j696f3Jj007040 for zsh-users@sunsite.dk; Sat, 9 Jul 2005 16:41:03 +1000 X-Authentication-Warning: localhost.localdomain: doug set sender to dougkearns@gmail.com using -f Date: Sat, 9 Jul 2005 16:41:03 +1000 From: Doug Kearns To: zsh-users@sunsite.dk Subject: Re: Help parsing a file from one regex to another Message-ID: <20050709064103.GC3825@localhost.localdomain> Mail-Followup-To: zsh-users@sunsite.dk References: <20050708073037.GB9744@localhost.localdomain> <1050708171627.ZM16747@candle.brasslantern.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1050708171627.ZM16747@candle.brasslantern.com> User-Agent: Mutt/1.4i X-Spam-Checker-Version: SpamAssassin 3.0.2 on a.mx.sunsite.dk X-Spam-Level: X-Spam-Status: No, score=-2.5 required=6.0 tests=AWL,BAYES_00 autolearn=ham version=3.0.2 X-Spam-Hits: -2.5 On Fri, Jul 08, 2005 at 05:16:27PM +0000, Bart Schaefer wrote: > On Jul 8, 5:30pm, Doug Kearns wrote: > } Subject: Re: Help parsing a file from one regex to another > } > } > I am trying to parse a range of data out of a file from one regular > } > expression up to another. The input starts with `^@main::FLAGS' and > } > goes up to the next `)' I am using awk right now, but it is *ugly* > } > } flags=( ${=${${${(f)"$(<$tmp_file)"}[(r)@main::FLAGS*,(r)\);]}#*\"}//[^[:upper:][:blank:]]/} ) > > That only works if the closing paren is on a line by itself, I think. > You need (r)*\); in the subscript expression, maybe even (r)*\);* if there > may be other stuff following the close-paren. Thanks for catching that. It 'worked' by accident and I didn't notice that the PRIORITIES had been pulled in too... I always forget that a non-matching pattern in the second expression causes the rest of the array to be selected. Is this documented somewhere that I'm missing? Regards, Doug