summary refs log tree commit diff
diff options
context:
space:
mode:
authorBart Schaefer <schaefer@zsh.org>2022-04-30 12:29:52 -0700
committerBart Schaefer <schaefer@zsh.org>2022-04-30 12:29:52 -0700
commitfc1ae21fdac97399163b93e26818fadebcc11cf7 (patch)
tree0126e90eb538f537b7fcbb54accc3028e2297d92
parent276020522e91212bed496c2048b1b24b0817218a (diff)
downloadzsh-fc1ae21fdac97399163b93e26818fadebcc11cf7.tar.gz
zsh-fc1ae21fdac97399163b93e26818fadebcc11cf7.tar.xz
zsh-fc1ae21fdac97399163b93e26818fadebcc11cf7.zip
unposted: Add details about ${(*)...} expansion
-rw-r--r--ChangeLog2
-rw-r--r--Doc/Zsh/expn.yo3
-rw-r--r--NEWS6
3 files changed, 10 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 1461e25bb..c8d35876f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2022-04-30  Bart Schaefer  <schaefer@zsh.org>
 
+	* unposted: Doc/Zsh/expn.yo, Etc/NEWS: Details about ${(*)...}
+
 	* 50150: Src/Modules/stat.c: Filenames need unmetafy for printing
 
 	* 50149: Etc/BUGS, Src/builtin.c, Src/jobs.c: Remove all =(...)
diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo
index bbacc6ae4..eb8cdbae5 100644
--- a/Doc/Zsh/expn.yo
+++ b/Doc/Zsh/expn.yo
@@ -1498,8 +1498,9 @@ form using `tt(%%)' will remove the same matches as for `tt(##)' in reverse
 order.
 )
 item(tt(*))(
+pindex(EXTENDED_GLOB, enable)
 Enable tt(EXTENDED_GLOB) for substitution via tt(${)...tt(/)...tt(}) or
-tt(${)...tt(//)...tt(}).
+tt(${)...tt(//)...tt(}).  Note that `tt(**)' does not disable extendedglob.
 )
 item(tt(B))(
 Include the index of the beginning of the match in the result.
diff --git a/NEWS b/NEWS
index 1ab4f0649..d7a817c1e 100644
--- a/NEWS
+++ b/NEWS
@@ -46,6 +46,12 @@ of CLOBBER for empty files only. It is disabled by default.
 A (-) expansion flag was added. It works like (n) but correctly sorts
 negative numbers.
 
+The (*) expansion flag enables EXTENDED_GLOB for pattern matching.
+For example, ${(*)sample/(#b)*(pat)*/${match[1]}} uses backreferences
+even if EXTENDED_GLOB is not otherwise set.  However, this does not
+descend into nested exapansions, and doubling as (**) does not disable
+EXTENDED_GLOB.
+
 The compinit function learnt a -w option to explain why compdump runs.
 When run without the -i or -u options and compaudit discovers security
 issues, answering "y" to the "Ignore insecure ..." prompt removes the