Zsh Mailing List Archive
Messages sorted by:
- X-seq: zsh-workers 38298
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxx
- Subject: EXTENDED_PATTERNS option?
- Date: Tue, 19 Apr 2016 10:17:51 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brasslantern-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:date:to:subject:mime-version; bh=aDlBz3C7UPehc3ChztEsJONbVh65TSJnqLPhHK2uVF8=; b=yt/kR8re1SXDq5ybuEig6U3m4oC5tBp6g6XM6O1lYMDNWmlnZ+eGV+n5gCapLgUd0I XNLKd6YmMJNO3+HpJ9t/nPY1or+VFlpBP91eQ1ozTYoWdMLPOEp/Xf8xS/KW/hML9rmo WZX7P3pZ40/ut4C5ARp4F2rFiiqFNJTtJJHdKZuCyYJ3wI6a48t/B9rWj0mPCTBGQQLA P/UuVkI1dC8PSdYJZqKXmz4vMYMfO88VNGbT7jiCl1xfnf8VTQdfklx2sjEe/P9jeNNj lqfHt7qh/VITFGd7RR65UCYylffZ2aDZrI3BCVzvIK5NZ1hh0hixFs/uP1LLtwqQa7tl bMWw==
- List-help: <mailto:email@example.com>
- List-id: Zsh Workers List <zsh-workers.zsh.org>
- List-post: <mailto:firstname.lastname@example.org>
- Mailing-list: contact zsh-workers-help@xxxxxxx; run by ezmlm
I have made no coding progress at all on the suggestion I'm about to make,
but for purposes of discussion:
Might it be sensible to separate the EXTENDED_GLOB features into two
contexts? Namely, filename generation and pattern matching, so that for
example one could have backreferences enabled in [[ ... ]] expressions
while at the same time NOT have "^" and "#" take on special meaning in
Thus the suggestion that EXTENDED_PATTERNS enables (#s), (#e), (#m), etc.
in conditional expressions, whereas EXTENDED_GLOB behaves as it now does
[An alternative worth careful consideration is to have EXTENDED_PATTERNS
active by default, and use EXTENDED_GLOB only during filename generation.
There is a small chance that some conditionals in existing code would
change behavior if this were done.]
One complication to this of course is that (#q) now turns on globbing
inside conditionals, and the (e::) glob flag evaluates conditionals, so
flipping global state of the pattern code on entry/exit of either context
is fraught with potential confusion -- perhaps so much so as to scuttle
Aside: Rope to hang yourself: [[ -f *(#qe:unsetopt extendedglob:) ]]
Aside part 2: Why doesn't (#q) work to cause globbing in [[ x = y ]] ?
The doc says "it can be forced in any case where normal shell expansion
is valid" but what does that mean inside a conditional?
Messages sorted by: