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

Re: [^ax-y] doesn't work but [^x-ya] does



Isn't the same problem showing up here?  Watch closely, I may be missing
the point...

  foo=a
  value=ac

  % print ${value//[${foo}]/x}
  xc

That's OK, only the a is replaced by an x.

  % print ${value//[b-z]/x}
  ax

That's OK, only the c is replace by an x.

  % print ${value//[${foo}b-z]/x}
  xc

Oops, should be a combination of the above effects, giving xx, which is
what you get if you expand the ${foo} by hand...

  % print ${value//[ab-z]/x}
  xx

To show it really is the dash...

  % value=ab
  % print ${value//[${foo}b-z]/x}
  xx

Unfortunately tracking down where this came in isn't much help as we
need to be able to get the correct overall effect of either Dash or
literal '-' in all cases, rather than just moving the problem around.

I wonder, however, if we're close to the point where we simply tokenise
it when it's not quoted and try to track down all the places where we
need to untokenise it.  There have been more fixes to
untokenisation since the previous attempt to guess where we need to
tokenise went in.

pws



Messages sorted by: Reverse Date, Date, Thread, Author