Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Help parsing a file from one regex to another
- X-seq: zsh-users 9066
- From: Doug Kearns <dougkearns@xxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Re: Help parsing a file from one regex to another
- Date: Sat, 9 Jul 2005 16:41:03 +1000
- In-reply-to: <1050708171627.ZM16747@xxxxxxxxxxxxxxxxxxxxxxx>
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- References: <e3b7bac05070723366cd51ebf@xxxxxxxxxxxxxx> <20050708073037.GB9744@xxxxxxxxxxxxxxxxxxxxx> <1050708171627.ZM16747@xxxxxxxxxxxxxxxxxxxxxxx>
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?
<snip>
Regards,
Doug
Messages sorted by:
Reverse Date,
Date,
Thread,
Author