From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9399 invoked by alias); 10 May 2016 05:17:17 -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: 21531 Received: (qmail 8808 invoked from network); 10 May 2016 05:17:16 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, T_DKIM_INVALID autolearn=ham autolearn_force=no version=3.4.1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=phn0EEqV5FKbBcioas+QAEvLP2A9tDDN5aEXMc0WCpU=; b=V/AJrYETfepCvHzkFjHDwyVpzG0P3xYLoouHTMaePypAxnb8p/neC75QFe8CNOhYjj MxOwuX+2Dx4iFhSqGZ6EmxK6L59ESfr7ZQ+Nev1XpCKZ2zz/Qx2qaAd2x9QS7OTin6mp pOgk6r5m6/fwiO6kxkGa3ftt520yXg6dnuHhI1G2hI8laEAXdhg9lwdUhQ5RD8Pu8DX7 GXa+lphblS+mTamnEYa3lz2rSn3seaHoUhKr0bNlJ/I3PiBZxDDtRwjOzWmU9mnRkdsm +5ezWnUm0VZzh5ZJaxBFBivQcsibUuLFknhy4BsvePohbn6yyJDAmj+GTTeVGXaHYEXi PxFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=phn0EEqV5FKbBcioas+QAEvLP2A9tDDN5aEXMc0WCpU=; b=PhwRu4yC4JGGs0BodLK8xATmx0rUmwHrp8blTgKxPrwa7Rw8nHBgfg7Wrc5hR1tM5d IIIl5S//Jd1M0BIMdeLEHkJU6aus7/O+m4fMjQnoYf5PusLHUaIfk3SVxwBRBVLIK+ZI TSa/sxU+kmgUM4cj9EpXX72/K0kV97pghk6GxH7J781bvTG02pwbWRVHjm9jacyuBeqQ wa8mFVDCc4L+ENkRHtMv+O/uTVPfFCbYheXBy37COwHIRDpDKuVBWhe4jpFcDBJIYnQq 4IebHK2HpvGPSM52+pZtvwyJayMK1rcLfylcWeTD+kxl0kFfb8Brt9PhIdT//8g0bv8o oTJg== X-Gm-Message-State: AOPr4FXkH0160IHCnWNwppa0yrUL8U1SNZDtHl6/dZmRaZIF7hu4PecjHS1sY9fGmwcWbMIbLP9Qr0ggSMl0ug== X-Received: by 10.25.22.86 with SMTP id m83mr16457888lfi.66.1462857433839; Mon, 09 May 2016 22:17:13 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <160509205620.ZM17429@torch.brasslantern.com> References: <160509205620.ZM17429@torch.brasslantern.com> From: Sebastian Gniazdowski Date: Tue, 10 May 2016 07:16:54 +0200 Message-ID: Subject: Re: Why approximate pattern doesn't match? To: Bart Schaefer Cc: Zsh Users Content-Type: text/plain; charset=UTF-8 On 10 May 2016 at 05:56, Bart Schaefer wrote: > On May 9, 10:11pm, Sebastian Gniazdowski wrote: > } Subject: Re: Why approximate pattern doesn't match? > } > } Hello again, > } it appears that the approximate matching works only for first word in > } the *~^* sequence: > } > } a=( "git push" ) > } pattern1='git*~^*pash*' > > I read that as: git followed by anything, except NOT matching (~) > anything NOT containing "pash". Who came up with that double-negative? It was Mikael > } Any solution? > > It doesn't seem so. > > /* > * By default, approximations are turned off in exclusions: > * we need to do this here as otherwise the code compiling > * the exclusion doesn't know if the flags have really > * changed if the error count gets restored. > */ > > So you don't get approximate non-matching, only approximate matching. Too bad.. I was quite optimistic that this is: if there is another matching run for consecutive ~^ block, then maybe some approximate matching flag is just lost in the process, and the fix will be easy :( What does above message mean, maybe it's 'just' "this is difficult as we have only one error count" ? > You can possibly refactor it this way: > > a=( "git push" ) > pat1='git*' > pat2='*pash*' > echo ${(@M)${(@M)a:#(#ia2)$~pat1}:#(#ia2)$~pat2} I get input from user, multiple space separated words Best regards, Sebastian Gniazdowski