Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
no wildcards/anchors allowed in pattern? ${f:s/pattern/_s&}
- X-seq: zsh-users 28050
- From: zzapper <zsh@xxxxxxxxxxxxxx>
- To: Zsh-Users List <zsh-users@xxxxxxx>
- Subject: no wildcards/anchors allowed in pattern? ${f:s/pattern/_s&}
- Date: Thu, 8 Sep 2022 12:56:41 +0100
- Archived-at: <https://zsh.org/users/28050>
- List-id: <zsh-users.zsh.org>
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