2009/9/17 erik quanstrom <quans...@quanstro.net>: > i don't think you need an extra () for the leading > white space. just tack it on in with the leading expression.
see below > the hoc is unnecessary. just start with 2. true :) > fn buildre { > re = 's:^([ ]*' > for(i in `{seq 2 $1}) > re = $re ^ '[^ ]+[ ]+' > re = $re ^ ')([^ ]+):\1' ^ $2: > } > > ; buildre 1 hell > ; whatis re > re='s:^([ ]*)([^ ]+):\1hell:' already here is a problem: 1) I am to save the leading space --- so it shouldn't be an argument to s. 2) only the 2nd () --- the word with no spaces in itself --- is to be changed ... since the spaces are to be preserved, none of them should be an argument to the s command, I think. That's why it was treated seperately by me. Anyway, what do you think about that problem with the empty group? Why linux is ok with it while plan 9 is not? Is there any reason? Is that a bug in plan9 sed? Thanks Ruda > ; buildre 2 hell > ; whatis re > re='s:^([ ]*[^ ]+[ ]+)([^ ]+):\1hell:' > > - erik > >