Sorry, didn't go to the list, agian...
On 08/09/2022 12:56 zzapper <zsh@xxxxxxxxxxxxxx> wrote:
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
The pattern expansion case has this syntax:
f=stuff.png
print ${foo/%(#m).png/_$MATCH}
stuff_.png
Look up the "m" globbing flag.
pws