about summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-04-14 11:49:31 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-04-14 11:49:31 +0000
commit2295c59fcb4f1e31ef05555318bf3b3b4a2df8f9 (patch)
tree564d732962ee8faa96689a21f6c85d5856239986 /Doc
parent3f114b3237c9d46f27cb13bec1e2d7a84e5bfead (diff)
downloadzsh-2295c59fcb4f1e31ef05555318bf3b3b4a2df8f9.tar.gz
zsh-2295c59fcb4f1e31ef05555318bf3b3b4a2df8f9.tar.xz
zsh-2295c59fcb4f1e31ef05555318bf3b3b4a2df8f9.zip
10756: fix (#s) and (#e) for parameter substitution forms
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/expn.yo10
1 files changed, 10 insertions, 0 deletions
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()