Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Bad "bad pattern" in ${foo//pat/repl} ?
- X-seq: zsh-workers 17452
- From: "Bart Schaefer" <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: Bad "bad pattern" in ${foo//pat/repl} ?
- Date: Sat, 13 Jul 2002 21:35:31 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
(Never mind why the elements of $foo have spaces in them, I was fooling
with something else when I came across this.)
schaefer<501> foo=("a b" "a c" "b q" "x y")
schaefer<502> echo ${foo/#a*/yes}
yes yes b q x y
schaefer<503> echo ${foo//#a*/yes}
a b a c b q x y
schaefer<504> setopt extendedglob
schaefer<505> echo ${foo/#a*/yes}
yes yes b q x y
schaefer<506> echo ${foo//#a*/yes}
zsh: bad pattern: #a*
Surely both 503 and 506 are bugs (probably the same bug). One should be able
to anchor to the beginning of the string even when doing a replace-all (I do
admit it doesn't really make sense to do so, but ...).
--
Bart Schaefer Brass Lantern Enterprises
http://www.well.com/user/barts http://www.brasslantern.com
Zsh: http://www.zsh.org | PHPerl Project: http://phperl.sourceforge.net
Messages sorted by:
Reverse Date,
Date,
Thread,
Author