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

no wildcards/anchors allowed in pattern? ${f:s/pattern/_s&}



Hi

This works for me and allows me to use memory '&' but I'm frustrated that I don't seem to be able to use anchors / wildcards etc in the pattern

f=dog.png ;echo $f '->' ${f:s/./_s&}
dog.png -> dog_s.png

the alternative syntax allows pattern to be a regexp but has no regexp memory


f=dog.png.png ;echo $f '->' ${f/%.png/_s.png}
dog.png.png -> dog.png_s.png

(be delighted to be told I'm wrong!)

zzapper





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