From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4f538c0e46da2504838ea771312e7c74@quanstro.net> From: erik quanstrom Date: Thu, 17 Sep 2009 16:46:55 -0400 To: 9fans@9fans.net In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Subject: Re: [9fans] awk help; not plan9 matter Topicbox-Message-UUID: 717d2b4e-ead5-11e9-9d60-3106f5b1d025 i don't think you need an extra () for the leading white space. just tack it on in with the leading expression. the hoc is unnecessary. just start with 2. fn buildre { re = 's:^([ ]*' for(i in `{seq 2 $1}) re = $re ^ '[^ ]+[ ]+' re = $re ^ ')([^ ]+):\1' ^ $2: } ; buildre 1 hell ; whatis re re='s:^([ ]*)([^ ]+):\1hell:' ; buildre 2 hell ; whatis re re='s:^([ ]*[^ ]+[ ]+)([^ ]+):\1hell:' - erik