zsh-users
 help / color / mirror / code / Atom feed
From: Philippe Troin <phil@fifi.org>
To: zsh-users@zsh.org
Subject: Re: Example of use of (S) flag
Date: Mon, 28 Dec 2015 10:23:07 -0800	[thread overview]
Message-ID: <1451326987.5990.3.camel@ceramic.home.fifi.org> (raw)
In-Reply-To: <151223210157.ZM447@torch.brasslantern.com>

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.



  parent reply	other threads:[~2015-12-28 18:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAKc7PVBLdXYQ_NNU9q=v9TcfiZjsYKfDt2h=ZBdfGCt6t81cuQ__14537.6145992943$1450895198$gmane$org@mail.gmail.com>
2015-12-23 23:25 ` Stephane Chazelas
2015-12-24  5:01   ` Bart Schaefer
2015-12-24  7:53     ` Sebastian Gniazdowski
2015-12-28 18:23     ` Philippe Troin [this message]
2015-12-28 19:13       ` Mikael Magnusson
2015-12-23 18:25 Sebastian Gniazdowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1451326987.5990.3.camel@ceramic.home.fifi.org \
    --to=phil@fifi.org \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).