Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: substitution groups and patterns i replace string (Emacs' \\1 etc.)
On Mar 6, 8:15am, Mikael Magnusson wrote:
}
} % echo ${a//(#b)([aoeui])/${(U)match[1]}}
It's actually quite simple to make $1, $2, ... refer to the values in
the $match array during ${v//p/r} substitutions. This would make the
syntax look very perl-ish, but would mean you can't combine backrefs
with expansions of the normal positional parameters.
Anyone interested? Discuss?
Incidentally, for a fun time consider replacing ${(U)match[1]} with
${(P)match[1]} in that substitution of Mikael's.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author