From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2292 invoked by alias); 28 Dec 2015 18:28:46 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 21104 Received: (qmail 6415 invoked from network); 28 Dec 2015 18:28:44 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 Message-ID: <1451326987.5990.3.camel@ceramic.home.fifi.org> Subject: Re: Example of use of (S) flag From: Philippe Troin To: zsh-users@zsh.org Date: Mon, 28 Dec 2015 10:23:07 -0800 In-Reply-To: <151223210157.ZM447@torch.brasslantern.com> References: <20151223232519.GA9602@chaz.gmail.com> <151223210157.ZM447@torch.brasslantern.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4 (3.10.4-4.fc20) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit On Wed, 2015-12-23 at 21:01 -0800, Bart Schaefer wrote: > Further note that (MS) is sort of a dumbed-down form of backreferences, > returning something similar to the value of $MATCH in an extendeglob > pattern that uses (#m) (except extendedglob is not needed). E.g.: 8< snip >8 > torch% echo ${(S)a/b*/x} > axcba > torch% echo ${(S)a//b*/x} > axcxa I don't understand why in these two examples the star doesn't match the rest of the string? I'd expect: % echo $a abcba % echo ${(S)a/b*/x} ax % echo ${(S)a//b*/x} ax Since b* should match the entire bcba substring. What did I miss? Phil.