about summary refs log tree commit diff
path: root/Doc/Zsh/expn.yo
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2000-05-08 08:58:37 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2000-05-08 08:58:37 +0000
commit38bb84d97577fdfc359ba0261daea730a0cfb405 (patch)
tree15222079b6024fea1a2d7636ca023bb2672196e2 /Doc/Zsh/expn.yo
parentbedd4cf2c57a89bec8bd98e6ed65082164b69d93 (diff)
downloadzsh-38bb84d97577fdfc359ba0261daea730a0cfb405.tar.gz
zsh-38bb84d97577fdfc359ba0261daea730a0cfb405.tar.xz
zsh-38bb84d97577fdfc359ba0261daea730a0cfb405.zip
11194, 11200, 11214
Diffstat (limited to 'Doc/Zsh/expn.yo')
-rw-r--r--Doc/Zsh/expn.yo10
1 files changed, 9 insertions, 1 deletions
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index ae81c1bb6..82f88358e 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -456,13 +456,21 @@ item(tt(${)var(name)tt(//)var(pattern)tt(/)var(repl)tt(}))(
 Replace the longest possible match of var(pattern) in the expansion of
 parameter var(name) by string var(repl).  The first form
 replaces just the first occurrence, the second form all occurrences.
+Both var(pattern) and var(repl) are subject to double-quoted substitution,
+so that expressions like tt(${name/$opat/$npat}) will work, but note the
+usual rule that pattern characters in tt($opat) are not treated specially
+unless either the option tt(GLOB_SUBST) is set, or tt($opat) is instead
+substituted as tt(${~opat}).
+
 The var(pattern) may begin with a `tt(#)', in which case the
 var(pattern) must match at the start of the string, or `tt(%)', in
 which case it must match at the end of the string.  The var(repl) may
 be an empty string, in which case the final `tt(/)' may also be omitted.
 To quote the final `tt(/)' in other cases it should be preceded by two
 backslashes (i.e., a quoted backslash); this is not necessary if the
-`tt(/)' occurs inside a substituted parameter.
+`tt(/)' occurs inside a substituted parameter.  Note also that the `tt(#)'
+and `tt(%)' are not active if they occur inside a substituted parameter,
+even at the start.
 
 The first `tt(/)' may be preceded by a `tt(:)', in which case the match
 will only succeed if it matches the entire word.  Note also the