From 2295c59fcb4f1e31ef05555318bf3b3b4a2df8f9 Mon Sep 17 00:00:00 2001 From: Peter Stephenson Date: Fri, 14 Apr 2000 11:49:31 +0000 Subject: 10756: fix (#s) and (#e) for parameter substitution forms --- Doc/Zsh/expn.yo | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Doc') diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 172949176..bac3c2094 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -1309,6 +1309,16 @@ are useful for matching path segments in patterns. For example, `tt(*((#s)|/)test((#e)|/)*)' matches a path segment `tt(test)' in any of the following strings: tt(test), tt(test/at/start), tt(at/end/test), tt(in/test/middle). + +Another use is in parameter substitution; for example +`tt(${array/(#s)A*Z(#e)})' will remove only elements of an array which +match the complete pattern `tt(A*Z)'. There are other ways of performing +many operations of this type, however the combination of the substitution +operations `tt(/)' and `tt(//)' with the `tt((#s))' and `tt((#e))' flags +provides a single simple and memorable method. + +Note that assertions of the form `tt((^(#s)))' also work, i.e. match +anywhere except at the start of the string. ) enditem() -- cgit 1.4.1