summary refs log tree commit diff
path: root/Doc
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2008-03-25 17:47:10 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2008-03-25 17:47:10 +0000
commit56e1904e45cc474a9858dc1205055008f8c63752 (patch)
tree075e089f92f9916e36feee06c38321c58dd1a97d /Doc
parent238df34af407d755a9c6fc94cade1272c7ea5b62 (diff)
downloadzsh-56e1904e45cc474a9858dc1205055008f8c63752.tar.gz
zsh-56e1904e45cc474a9858dc1205055008f8c63752.tar.xz
zsh-56e1904e45cc474a9858dc1205055008f8c63752.zip
fix optimisation of string matching with multibyte mode
24732: attempt to provide adequate space for sched ztrftime string with
multibyte characters
Diffstat (limited to 'Doc')
-rw-r--r--Doc/Zsh/params.yo30
1 files changed, 16 insertions, 14 deletions
diff --git a/Doc/Zsh/params.yo b/Doc/Zsh/params.yo
index 797fc3e0e..48e1838bf 100644
--- a/Doc/Zsh/params.yo
+++ b/Doc/Zsh/params.yo
@@ -234,16 +234,14 @@ subscript 0; this is empty unless one of the options tt(KSH_ARRAYS) or
 tt(KSH_ZERO_SUBSCRIPT) is in effect.
 
 Note that in subscripts with both `tt(r)' and `tt(R)' pattern characters
-are active even if they were substituted for a parameter (regardless
-of the setting of tt(GLOB_SUBST) which controls this feature in normal
-pattern matching).  It is therefore necessary to quote pattern characters
-for an exact string match.  Given a string in tt($key), and assuming
-the tt(EXTENDED_GLOB) option is set, the following is sufficient to
-match an element of an array tt($array) containing exactly the value of
-tt($key):
+are active even if they were substituted for a parameter (regardless of the
+setting of tt(GLOB_SUBST) which controls this feature in normal pattern
+matching).  The flag `tt(e)' can be added to inhibit pattern matching.  As
+this flag does not inhibit other forms of substitution, care is still
+required; using a parameter to hold the key has the desired effect:
 
-example(key2=${key//(#m)[\][+LPAR()+RPAR()\\*?#<>~^]/\\$MATCH}
-print ${array[(R)$key2]})
+example(key2='original key'
+print ${array[(Re)$key2]})
 )
 )
 item(tt(i))(
@@ -286,11 +284,15 @@ evaluates to var(n)).  This flag is ignored when the array is associative.
 The delimiter character tt(:) is arbitrary; see above.
 )
 item(tt(e))(
-This flag has no effect and for ordinary arrays is retained for backward
-compatibility only.  For associative arrays, this flag can be used to
-force tt(*) or tt(@) to be interpreted as a single key rather than as a
-reference to all values.  This flag may be used on the left side of an
-assignment.
+This flag causes any pattern matching that would be performed on the
+subscript to use plain string matching instead.  Hence
+`tt(${array[(re)*]})' matches only the array element whose value is tt(*).
+Note that other forms of substitution such as parameter substitution are
+not inhibited.
+
+This flag can also be used to force tt(*) or tt(@) to be interpreted as
+a single key rather than as a reference to all values.  It may be used
+for either purpose on the left side of an assignment.
 )
 enditem()