From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=DKIM_ADSP_CUSTOM_MED, FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham autolearn_force=no version=3.4.2 Received: from primenet.com.au (ns1.primenet.com.au [203.24.36.2]) by inbox.vuxu.org (OpenSMTPD) with ESMTP id b9a061ba for ; Tue, 3 Dec 2019 14:46:41 +0000 (UTC) Received: (qmail 15886 invoked by alias); 3 Dec 2019 14:46:06 -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: List-Unsubscribe: X-Seq: 44980 Received: (qmail 22424 invoked by uid 1010); 3 Dec 2019 14:46:06 -0000 X-Qmail-Scanner-Diagnostics: from mail-vs1-f52.google.com by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.102.0/25649. spamassassin: 3.4.2. Clear:RC:0(209.85.217.52):SA:0(-2.0/5.0):. Processed in 3.656502 secs); 03 Dec 2019 14:46:06 -0000 X-Envelope-From: sgniazdowski@gmail.com X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at _netblocks.google.com designates 209.85.217.52 as permitted sender) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=1LFTeH5oyJyVkldS2BXo/FA4M/lTwabm4aOXNVm0CIQ=; b=ExwXnzSPrVfndUni55qoZrqgrbhXbB7CJc3a+aL/X7tfpmyonZdB8nTEUi7RvN2xuj DOTvd2bklEldFO3RoYqcd6TDvNhthmdqAzEQb3N5xh9PYP35IwJjPbu2Yx8bNqT7lQ6u P2DhoEc8lbmTu44oHatwEC3Ld4RDnDrQNsE7X/l6u9b7iJslxsBo/ftviU5U4+oyH6Ka 66jC2PO1wM+T566FgtOZiBBotl9Bxrp/+qUSbCDeAbu9TmkgwPbkuHxRiXD1Dv9R+9LG D7aFEVPrKwos6yVkAgg9evILtQK12JeN5zR2NxZXgZ7jnsZv2Pznr88dy702F+9bhemk 6E5A== X-Gm-Message-State: APjAAAXpxLOSoSFyt8RbKbvXKruhtJ0ixGfcix41l2VDsqldNdLhJ7tJ 0ViTpzXTxFEJXrKBmJCdPa0Mgij6hBb5zy528JU= X-Google-Smtp-Source: APXvYqy4t6sLZNf5810Xm8/hPMdQLCsY1BpLda7fXcBY5Swag/e04kQNxySBEsE74Lqtqy6GnU7SuMHEZqsVIn3x3CQ= X-Received: by 2002:a67:cfcc:: with SMTP id h12mr3103498vsm.198.1575384328460; Tue, 03 Dec 2019 06:45:28 -0800 (PST) MIME-Version: 1.0 References: <1575366176.5200.3.camel@samsung.com> In-Reply-To: <1575366176.5200.3.camel@samsung.com> From: Sebastian Gniazdowski Date: Tue, 3 Dec 2019 15:45:16 +0100 Message-ID: Subject: Re: PATCH: Update the description of S flag in the completion To: Peter Stephenson Cc: Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000485cb80598cdbf88" --000000000000485cb80598cdbf88 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable wt., 3 gru 2019, 10:43 u=C5=BCytkownik Peter Stephenson napisa=C5=82: > On Tue, 2019-12-03 at 06:16 +0100, Sebastian Gniazdowski wrote: > > On Mon, 2 Dec 2019 at 01:46, Sebastian Gniazdowski > > wrote: > > > > > > > > > On that occasion, isn't this a bug?: > > > > > > =E2=9D=AF str=3D"ab##c#d"; print ${(S)str##\#} > > > ab#c#d > > > =E2=9D=AF str=3D"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. --000000000000485cb80598cdbf88--