Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Help parsing a file from one regex to another



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