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=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FROM,HTML_MESSAGE,MAILING_LIST_MULTI, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7250 invoked from network); 5 Jun 2022 12:23:40 -0000 Received: from zero.zsh.org (2a02:898:31:0:48:4558:7a:7368) by inbox.vuxu.org with ESMTPUTF8; 5 Jun 2022 12:23:40 -0000 ARC-Seal: i=1; cv=none; a=rsa-sha256; d=zsh.org; s=rsa-20210803; t=1654431820; b=nZWUxhjoRBWe9J4EzY5sZ8o1+dfChIySWozafhI4rsx1m35iEBhqLeVCaAB6EsDqFMrgFZRPAC EnR3S0T3KvdtVWrylBu/M8bmntoq0XFr+SzSd3YdIAeZFpmIN0wDZmP8DoZ7IeRyXf1WEcpE2M fqtnEVg5tFXfrIa9uSCtloJRq/xUAdJSIQRSP781utoe4QTYLG5FC3V/qM0v8eBCJWx0Bb2usj E4HX5SdwA/Th78npwV3qybafm//291bpl/XjKIRneVTql9un2PZUihrCtkbJbpTxp/sMcfvEoW CLwJc4PHCj5rtwrY/mvgg+fVxIAsEpezoRU3lAtwTNH0lQ==; ARC-Authentication-Results: i=1; zsh.org; iprev=pass (mail-vs1-f41.google.com) smtp.remote-ip=209.85.217.41; 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=1654431820; bh=Ne5lHQnKcYQ7MvscrSW9yY3GMn3vPDvnSzMbDK8KLNs=; h=List-Archive:List-Owner:List-Post:List-Unsubscribe:List-Subscribe:List-Help: List-Id:Sender:Content-Type:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:DKIM-Signature:DKIM-Signature; b=qTuxAjbh3BkDFLS2kMbIA2t/CoFU98CluNR9n1IC40kHYNtV0DDZcHb9xI3UeS084T7DoWivdL qXajIdIKqXTUc4JgZKTIUr/rX/s4KirQbsgmt7K5S16ycnlI0QwRs4ww8LBsSqq2U0RZpPcHxI lKzUxo8d1TQodgmibHPsReDJwlE8pwqesIw4FjCrWDHsYrJkKQofbaBO7NRh3/JDFGTqJG/p96 Vm6yDThcELLAEnp3OLUexxy+iBM961TI6fjcE/isaIuqBGEF0APokTcQcJ6051jdzo040UoNnI X/xrwjxolHjxgSEfN9k2jj//rNiYNfT6PvXxzLAc5smqZg==; 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:In-Reply-To:References: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; bh=ZoNvQH3py5VrCDBHdt+KE39CXq0BF1iI519cgpGAJck=; b=UIBjbwi/fvvT63ylOEI3jKQ6W/ T7tAo/N2cgPAWY6E39vApXi0quofrr5ndNY9Mh7sb9mByweHRPMRA6bJ0WoI5+OMF3BhOR7FBjeTh 5v2l59pkEeEX86o40vh/zAygH7kTvkqrSlxTGFWoA6neh6JQft7JoyRrZiE0obY/Ae/ccjpRTpb0x 5AIo4gIxQCY6tYDErQJ5eeZVDis9662XFGxa4KF83YsglVkjQx+nWXnko7Hn18FXRKMxlUKo6/l+h ToJFDM36YQkG/lCmJw+yLYQ/PptKzbY3NLTw0x3HpZH8qhUaSKRn554xQyM34ZPmuLHQO2eO2xuoK i3tLSacQ==; Received: from authenticated user by zero.zsh.org with local id 1nxpI9-00029f-7U; Sun, 05 Jun 2022 12:23:37 +0000 Authentication-Results: zsh.org; iprev=pass (mail-vs1-f41.google.com) smtp.remote-ip=209.85.217.41; dkim=pass header.d=gmail.com header.s=20210112 header.a=rsa-sha256; dmarc=pass header.from=gmail.com; arc=none Received: from mail-vs1-f41.google.com ([209.85.217.41]:39506) by zero.zsh.org with esmtps (TLS1.3:TLS_AES_128_GCM_SHA256:128) id 1nxpHW-0001q2-QE; Sun, 05 Jun 2022 12:23:00 +0000 Received: by mail-vs1-f41.google.com with SMTP id n4so2553713vsm.6 for ; Sun, 05 Jun 2022 05:22:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=ZoNvQH3py5VrCDBHdt+KE39CXq0BF1iI519cgpGAJck=; b=LBWoIh+GwRTTbtx4Q9wQ8jUjJzaIdPXR/jEXpAYbAEIwUMj3B7feREiehMUKZEEm2Z NBROtCwaqyB1m+ZbtXEsPhixLzAuPOc8fdnZuq8pCwW+C8j8OX43Sclf8kvHEqHZE00l AXPLhWEdz6BX3+kUkcjWlIiJWa4tyfddurhc1Gvh/aLiTQyrKAfHpF6SXdaiDs/hodYH 32gDOvqHjcDGo1Dbnn55O8kz4O0VIOsyIpt+DrJdUShy4ZbPVgRHPvlO/ccGY+gRQsQl mK/PPeosV/B4KzAHH8xI8VCG7J/LGRbmiLOhNiUDYZ+rqlZx/TB1sI+MQqmjEDnaG0au dvtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=ZoNvQH3py5VrCDBHdt+KE39CXq0BF1iI519cgpGAJck=; b=0DZ/geT8dYFnlPJtjqClEyOTWn7qKtREq/5WOuHqIYicOe9c50SJTpjMxJImreCQQ+ f7mhtcwseShTEBjfneLrLSl029EMxTle4Fa071IWKtdC5MMQkuUooZjRA2ncAM+N6W0C X2aY13fBJpi7CvRACPVZe/E+FPAmX9UmI74oDNHTHMD1ZgKD//lMD+q0noX0F6v7diUm oW2Q2M7nzEPxLTLctdhhgy2azBQQ4tUFTLIabTbM8NwkPzUC/YkjCcJZ4kIPTbMa7sPv q2+4wOXIEMgzczZud0wdJOF0qG7ZhxzKM0D0GA3yBeihN75BqH2yHqusr9AB7+9hcW3m OIQw== X-Gm-Message-State: AOAM531Aw6/HASTP1A0gfd+9Cv5Mn2qhTF7RTrEq1VxrPB4weavr6buS IhAtfcn+azMY3bOXgIomk3hBwF6gf7ur3xcIHumNi7lbPzA= X-Google-Smtp-Source: ABdhPJyc4W7RSM5ifBXDxXjT9D5d9B6pRArXqgK2r9KD3sP4l+Mpv7W5qjHSs+V+KJDo7uV1GqattTYsT05vtG4XGJw= X-Received: by 2002:a67:cb1a:0:b0:337:8b5c:53d8 with SMTP id b26-20020a67cb1a000000b003378b5c53d8mr32082095vsl.56.1654431777376; Sun, 05 Jun 2022 05:22:57 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Sebastian Gniazdowski Date: Sun, 5 Jun 2022 14:22:44 +0200 Message-ID: Subject: Re: How to repel a space separated quoted strings with ~? To: Zsh hackers list Content-Type: multipart/alternative; boundary="00000000000065568705e0b26a8b" X-Seq: 50337 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: --00000000000065568705e0b26a8b Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable the solution is to pre-split with Z flag then replace spaces with some special char like mom breaking space then join then apply the pattern then replace back niedz., 5 cze 2022, 11:12 u=C5=BCytkownik Sebastian Gniazdowski < sgniazdowski@gmail.com> napisa=C5=82: > Hi > Consider the following: > > ice=3D"a|b|c|d" > x=3D"a b X c' x' d' e' Z" > > if [[ $x =3D (#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 possibl= y > followed by a glued quoted strings and block of a capital letter. The > repel negation ~ is successful at preventing matching lower letters at th= e > 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 > > --00000000000065568705e0b26a8b Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
the solution is to pre-split with Z flag then replace spa= ces with some special char like mom breaking space then join then apply the= pattern then replace back=C2=A0

niedz., 5 cze 2022, 11:12 u=C5=BCytkownik S= ebastian Gniazdowski <sgniazdo= wski@gmail.com> napisa=C5=82:
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

--00000000000065568705e0b26a8b--