From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Peter Stephenson <p.stephenson@samsung.com>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: PATCH: Update the description of S flag in the completion
Date: Tue, 3 Dec 2019 15:45:16 +0100 [thread overview]
Message-ID: <CAKc7PVBVOKVnE+GTntTx0r_KZu-4Bor+mrpyjQhn_BDzcHkwTg@mail.gmail.com> (raw)
In-Reply-To: <1575366176.5200.3.camel@samsung.com>
[-- Attachment #1: Type: text/plain, Size: 1178 bytes --]
wt., 3 gru 2019, 10:43 użytkownik Peter Stephenson <p.stephenson@samsung.com>
napisał:
> On Tue, 2019-12-03 at 06:16 +0100, Sebastian Gniazdowski wrote:
> > On Mon, 2 Dec 2019 at 01:46, Sebastian Gniazdowski
> > <sgniazdowski@gmail.com> wrote:
> > >
> > >
> > > On that occasion, isn't this a bug?:
> > >
> > > ❯ str="ab##c#d"; print ${(S)str##\#}
> > > ab#c#d
> > > ❯ str="ab##c#d"; print ${(S)str##\##}
> > > ab##c#d
> > >
> > > Why no match at all in the second case?
> > Any update on this? It would be good that the rarely-used flags are
> reliable.
> >
>
> You've got an expression which can match an empty string which you're
> also telling to match a substring so it can match an empty string
> anywhere. The order in which it tries to match will be crucial so this
> is not a useful thing to attempt. What are you actually trying to do?
>
I was expecting that it'll do a greedy match. Turns out, as Oliver writes,
that there's something like "nonexhaustive" greedy match which seems to
work like (|\###) so this pretty much explains it. I wasn't doing anything
particular, just testing the flags before updating the description.
next prev parent reply other threads:[~2019-12-03 14:46 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-02 0:31 Sebastian Gniazdowski
2019-12-02 0:46 ` Sebastian Gniazdowski
2019-12-03 5:16 ` Sebastian Gniazdowski
2019-12-03 9:42 ` Peter Stephenson
2019-12-03 14:45 ` Sebastian Gniazdowski [this message]
2019-12-03 10:39 ` Oliver Kiddle
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=CAKc7PVBVOKVnE+GTntTx0r_KZu-4Bor+mrpyjQhn_BDzcHkwTg@mail.gmail.com \
--to=sgniazdowski@gmail.com \
--cc=p.stephenson@samsung.com \
--cc=zsh-workers@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).