From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13420 invoked by alias); 25 Feb 2017 22:56:57 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 40641 Received: (qmail 17581 invoked from network); 25 Feb 2017 22:56:57 -0000 X-Qmail-Scanner-Diagnostics: from out4-smtp.messagingengine.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(66.111.4.28):SA:0(-0.7/5.0):. Processed in 1.430991 secs); 25 Feb 2017 22:56:57 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: d.s@daniel.shahaf.name X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: none (ns1.primenet.com.au: domain at daniel.shahaf.name does not designate permitted sender hosts) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= daniel.shahaf.name; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=E6GCGquH+L9Nj5d sGFFgftnC9Rk=; b=BcDo05u+yNU+VkSXBpDA3QuiWbbatdaNXXle4ssrvhyt1Ja 5iDZ23d2u92YZL02mBhtN8VxjXKh5HS2EMdfQt3Hapn2ALH0gn1PhYDnP2qQaa35 gIjsqQ7+Q0/jlpA5Ep08HsbGsE2klmPt+XpUzfU9wSazwbZJjY1dfqxl3bts= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=smtpout; bh=E6GCGquH+L9Nj5 dsGFFgftnC9Rk=; b=WXCVnmiRL9lQFuYiQdY6JI7Zdk7DxQ6sv5pfelE/2RtR/9 npIT+ZFRCku0pgC8nYFDmO9b1lwOxZj3bswQaKTx+J2Az5Jn7m6TQUkZuqz6ZUb/ DlCz8E7yVL/HDGPf6kMjyjlB+DrSPTVFmqD3ikoGCarS9tW7GFTPMvIBFAysU= X-ME-Sender: X-Sasl-enc: CKFdwu+CR5hr++o5w1DW/krzKpbqZl/dIv2X2uMhnGj5 1488063410 Date: Sat, 25 Feb 2017 22:52:19 +0000 From: Daniel Shahaf To: zsh-workers@zsh.org Subject: Re: Feature request (#b)...(...) Message-ID: <20170225225219.GA3818@fujitsu.shahaf.local2> References: <1488011830.2241447.892433784.52D183B6@webmail.messagingengine.com> <20170225151315.GA4424@fujitsu.shahaf.local2> <1488037019.2320483.892622496.169D8730@webmail.messagingengine.com> <170225084736.ZM22286@torch.brasslantern.com> <1488045262.2349123.892698344.1068648E@webmail.messagingengine.com> <170225130525.ZM22939@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <170225130525.ZM22939@torch.brasslantern.com> User-Agent: Mutt/1.5.23 (2014-03-12) Bart Schaefer wrote on Sat, Feb 25, 2017 at 13:05:25 -0800: > On Feb 25, 9:54am, Sebastian Gniazdowski wrote: > } > } ${a//(#b)ab(|c)/x} "<- last one shows | isn't greedy" > } x x xc <- last one shows | isn't greedy > > Yes, you're correct. Putting the shorter (in this case empty) alternate > first in the parens makes that particular subexpression non-greedy. This > was a deliberate choice -- though I can't find that it's been documented > anywhere, on a brief search. diff --git a/Doc/Zsh/roadmap.yo b/Doc/Zsh/roadmap.yo index bd064e2..94ef74d 100644 --- a/Doc/Zsh/roadmap.yo +++ b/Doc/Zsh/roadmap.yo @@ -139,6 +139,9 @@ startitem() item(tt(**))( for matching over multiple directories ) +item(tt(|))( +for matching either of two alternatives +) item(tt(~), tt(^))( the ability to exclude patterns from matching when the tt(EXTENDED_GLOB) option is set diff --git a/Doc/Zsh/expn.yo b/Doc/Zsh/expn.yo index 43ecd31..319409d 100644 --- a/Doc/Zsh/expn.yo +++ b/Doc/Zsh/expn.yo @@ -2100,6 +2100,7 @@ Matches either var(x) or var(y). This operator has lower precedence than any other. The `tt(|)' character must be within parentheses, to avoid interpretation as a pipeline. +The alternatives are tried in order from left to right. ) item(tt(^)var(x))( (Requires tt(EXTENDED_GLOB) to be set.)