From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-3.4 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 14001 invoked from network); 5 Jun 2022 09:12:49 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 5 Jun 2022 09:12:49 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1654420369; b=HJiOcQ64LtDsNIK7wsXObuoo7vrBovhCaKIGmtaVzFjC+Bum7N8b6Y1t4q2SSNYZRI4oJ6L0K0 lRIJlvuDKEMPvzaesqdOmUAWIx7cgPWlN0FUSdpPHrqsdZOJsU85/7qDtRqp8xj2hvveT8ixsq cYZZ2LNhtf+2lP1iN+1mFenTZNoKfpisJRHY9GpeCgFmrkTfSqlH99X/jkzZ3qtqfxNCrnoc+I 0TMWBXRqbfdMCL+moU7YQVWDF9LacksKIKkySj85/Flovv6vZCvNCdGol5rlB7mZ4qCLSUbEdG B75a+88vOUgq/4Oae96xU5EzwBpkW728aH5znE1pAGCR3A==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vk1-f170.google.com) smtp.remote-ip=209.85.221.170; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed; d=zsh.org; s=rsa-20210803; t=1654420369; bh=s5FjIlz+58OSyKWReCHZZhR6tOE3PzHEaOPCu/fxodw=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:MIME-Version: DKIM-Signature:DKIM-Signature; b=OhiK70G/Qual9FNCvaQzZMM3HFGA5M3K6widIF0RuGf4foY7X0I7SwgeXyvDeAI5F5Dc8PbsWi ZqYeWzS6Tr7UuCSjkWb6m1yHkpVUVdruP4o4lcN+faJdSYlyEHuf5kaVnRo8NflH4MGRwUNjPv jgEvVHT25loNk1Cn1vSm3dDgCbZa4ZZLgFs38AHtX9cM5VyWGMjK3snLiCo/OkeivFqVBYe5dY L1ERmhfEH3rYiSejBWmRJID7QbTJ7g+9SlnQBaMZeKLPSqjtd66iUMquuslAR9FCkF/MWE/EGp 71ajgO2OHXAGOkHpdMYN+UIt4pwRzKqX+MFmGZNTSOynLg==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=zsh.org; s=rsa-20210803; h=List-Archive:List-Owner:List-Post:List-Unsubscribe: List-Subscribe:List-Help:List-Id:Sender:Content-Type:To:Subject:Message-ID: Date:From:MIME-Version:Reply-To:Cc:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References; bh=J7F5fcf2N6+dyOO91KGuphHC8T9KonyyX+sT7p1FinI=; b=UjQ876FHEnWmMf1ahjhjKn+OF8 3r7RArnKVZ3fHDZCb2v8LBn3BEVRo3bOM/0kSu3Uvf/oUyo0fb/ZG3PKti729ZMvRuQsdYBUW7WMj 5O241pi8d4DDLsPyPZbksdcBIgcq8/ZPtU2fh+xjXv0jROGLeKqQiPsfJpagBgmwJbw6bgFvv7p3u b23xeIwae0NTXp3kmZBK9mskP225fo+SL/pfnpMSVUtvBIwuNw/38Xm0J8wb6AtxBS8oNCvGtZ1Lm 94/PEY4dmw/mwXnR6LJ+ZMMXKks2ceZN40gmq9hF6oyQQgIyZkZ5YqtSHWvnRfLb/SHQcVJQk8pkM m/ZExQCw==; Received: from authenticated user by zero.zsh.org with local id 1nxmJQ-000NDQ-D9; Sun, 05 Jun 2022 09:12:44 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vk1-f170.google.com) smtp.remote-ip=209.85.221.170; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vk1-f170.google.com ([209.85.221.170]:46887) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nxmJ9-000MuN-04; Sun, 05 Jun 2022 09:12:27 +0000 Received: by mail-vk1-f170.google.com with SMTP id b144so5126741vkb.13 for ; Sun, 05 Jun 2022 02:12:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:from:date:message-id:subject:to; bh=J7F5fcf2N6+dyOO91KGuphHC8T9KonyyX+sT7p1FinI=; b=buF26WYJp8RM/wurBmny94ofvEvW1BaA+3Y51ullrS5BOaozGvrBfPD8ovCsDEEMAb 7GGx4TVi50WJed7n734+qR/RcSY8h8GkyAj9bqOtParSKClat2wO+V6RKA4d8nYyTOxm sApIrMxK+T2BPx2H6yIj+zXUpEBFiWcRSfrc7Z5Lv+jDIm1Hre3B3yqe6+8imJB/WwTb vKpDcye//0kl7z0x6jllkX5V/IAgNohuSeu98Ffq0pGxQEhttkeUgN9E7PO7mKL1fTAK igvPLvwiH3KA/QNJdnPnxoyzfb+s9PSDQ11heu13miVZuHHB6HB0ASr33GPHQVdUITM6 kOdw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=J7F5fcf2N6+dyOO91KGuphHC8T9KonyyX+sT7p1FinI=; b=tuWraaIGfqnkvVXxLOWXbEMp09p05y74AvkBliArqCAKQGnltJkt1Ntc+FBzDH5Jyv wcgmE+DgzvKXEFsma82bPGi5pInXQbEhxODChNu9d2P1fF1dh8US72a4aSAdmMfALK3x 9YPq4nhagdgJzGMRUrPsX748JNk8YSD7Rt9N1eY9zA7Nj/BMvY8qYdRHl+Q7gNbYcFYR FXlhibaR/IvfCXp7ohoSw/DM+i0rq+DpS6oY7nP82loaFJp9kdJVGFxyLSZwwCB/elMM LQSIQkMLWaHGU3LEjJfV1gkR32PdZ3bYHxqsG88hEAdktGgonEv1tjbD94DS6x0susH3 +Zmg== X-Gm-Message-State: AOAM531Ur8OzqBBWO1Khd/u++Z05o1I3cJ51fMSzBCINHlCtm2Rt2WzC BSImfAt6L8ZVcEV/fjAG1h4TNOVaErUnjuoGR/rPpNkp6e0= X-Google-Smtp-Source: ABdhPJz/xS7MPPIyLOTde8EeQeCrpl9PB8cvKV83TLNQGSSHqdtFrCTINtaw+QP83qhgMwOR+8uRvqDMpZqV1euXS0U= X-Received: by 2002:a1f:ae91:0:b0:35d:2b08:78b with SMTP id x139-20020a1fae91000000b0035d2b08078bmr8221933vke.6.1654420345485; Sun, 05 Jun 2022 02:12:25 -0700 (PDT) MIME-Version: 1.0 From: Sebastian Gniazdowski Date: Sun, 5 Jun 2022 11:12:13 +0200 Message-ID: Subject: How to repel a space separated quoted strings with ~? To: Zsh hackers list Content-Type: multipart/alternative; boundary="000000000000007e7405e0afc13c" X-Seq: 50336 Archived-At: X-Loop: zsh-workers@zsh.org Errors-To: zsh-workers-owner@zsh.org Precedence: list Precedence: bulk Sender: zsh-workers-request@zsh.org X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: --000000000000007e7405e0afc13c Content-Type: text/plain; charset="UTF-8" Hi Consider the following: ice="a|b|c|d" x="a b X c' x' d' e' Z" if [[ $x = (#b)(((($~ice)*\ )#)((([^[:space:]]#)~(#B)(($~ice)*))\ ))#((#B)(($~ice)*\ )##)(Z) ]]; then pl $match fi Output: a b X c' x' a b X c' a b X c' a x' x' x' d' e' Z The goal is to match blocks of lower letters specified by ice var possibly followed by a glued quoted strings and block of a capital letter. The repel negation ~ is successful at preventing matching lower letters at the capital paren however only if not glued by a string. Is there a way to repel also such strings ? The output should be: ... ... ... c' x' d' e' Z --000000000000007e7405e0afc13c Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi
Consider the following:=C2=A0

ice=3D"a|b|c|d"
x=3D"a b X c' x' d' e' Z"

if [[ $x =3D=C2=A0 =C2=A0(#b)(((($= ~ice)*\ )#)((([^[:space:]]#)~(#B)(($~ice)*))\ ))#((#B)(($~ice)*\ )##)(Z) ]]= ; then
=C2=A0 =C2=A0 pl $match
fi

Output:=C2=A0
=
a b X c' x'
a b X c'
a b X c'
a
x'
x'
x'= ;
d' e'
Z
=

The goal is= to match blocks of lower letters specified by ice var possibly followed by= a glued quoted strings and block of a capital letter.=C2=A0 The repel nega= tion ~ is successful at preventing matching lower letters at the capital pa= ren however only if not glued by a string.=C2=A0 Is there a way to repel al= so such strings ?

The ou= tput should be:=C2=A0
...
...
...
c' x' d' e'
Z

--000000000000007e7405e0afc13c--