zsh-users
 help / color / mirror / code / Atom feed
* no wildcards/anchors allowed in pattern? ${f:s/pattern/_s&}
@ 2022-09-08 11:56 zzapper
       [not found] ` <826663136.300323.1662640732618@mail.virginmedia.com>
  0 siblings, 1 reply; 3+ messages in thread
From: zzapper @ 2022-09-08 11:56 UTC (permalink / raw)
  To: Zsh-Users List

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



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-09-08 13:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-08 11:56 no wildcards/anchors allowed in pattern? ${f:s/pattern/_s&} zzapper
     [not found] ` <826663136.300323.1662640732618@mail.virginmedia.com>
2022-09-08 13:16   ` Peter Stephenson
2022-09-08 13:57     ` zzapper

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).