From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22353 invoked by alias); 11 Nov 2014 17:43:34 -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: 33678 Received: (qmail 20515 invoked from network); 11 Nov 2014 17:43:33 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-type:content-disposition:in-reply-to :user-agent; bh=GqYd0GHRhV6pftscnjpnICpBVqqiFgA5WmNE1+Tm1Gg=; b=GD7IuJa245iYwn8zJ08OOChqEQN7S+x4ZaDLc09Gf6GuDFeSJImwFdh07O7gaQEQg0 S/C9xTwoj1QDY4KKPNPQrmN8Q+T1TPhfSUeDCjWAwIQ5jQNqdSOhIIHRS83I6JsGgwtD JP32CbKRlD8hTFW44iCMgwM6fDhimKFbWOY2a4j6GaRnBE3GkvW39JKhMTCJQqZuxyzW Vsmn3nrzh6AoMC2Q2R9kiJ1ZeE1B03hcQC/caROQcEXhK2FpRXmmBrQnb5tjI9QA+dth EV8fbfWej0JBCNsjeLG3VcC92Wt2nlDDfALeGKwsLkB2DJmEo1ur/atZnJuY2cOm7gFP VQ/Q== X-Received: by 10.194.243.164 with SMTP id wz4mr17603831wjc.129.1415727808131; Tue, 11 Nov 2014 09:43:28 -0800 (PST) Date: Tue, 11 Nov 2014 17:43:26 +0000 From: Stephane Chazelas To: Bart Schaefer Cc: Zsh hackers list Subject: Re: (#m) and "case" alternation Message-ID: <20141111174326.GD4343@chaz.gmail.com> Mail-Followup-To: Bart Schaefer , Zsh hackers list References: <20141111125423.GA4343@chaz.gmail.com> <141111074407.ZM30753@torch.brasslantern.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <141111074407.ZM30753@torch.brasslantern.com> User-Agent: Mutt/1.5.21 (2010-09-15) 2014-11-11 07:44:07 -0800, Bart Schaefer: > On Nov 11, 12:54pm, Stephane Chazelas wrote: > } > } Some unexpected behaviour: > } > } $ case abc in ((#m)a* | b*) echo $MATCH; esac > > It shouldn't be unexpected, because it's documented: > > m > Set references to the match data for the entire string matched; > this is similar to backreferencing and does not work in filename > generation. THE FLAG MUST BE IN EFFECT AT THE END OF THE PATTERN, > i.e. NOT LOCAL TO A GROUP. > > (all-caps mine). OK, but in: case abc in (#m)a* | b*) echo $MATCH; esac my understanding was that we've got two patterns as that's the "|" case alternation operator, not the "|" glob operator (with which you can't have spaces on either side).. Now, it looks like my understanding is wrong as $ case bcd in ((#b)(a*) | (#b)(b*)) print -l "$match[@]";;esac bcd (bcd is in $match[2], so the second group of a *single* pattern). So thanks for the clarification, you may disregard my report. -- Stephane