zsh-workers
 help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: How to repel a space separated quoted strings with ~?
Date: Sun, 5 Jun 2022 11:12:13 +0200	[thread overview]
Message-ID: <CAKc7PVAP997mgSrx4hAk5cEKOwXxpia6sKeH0U-LEJSCkoXv=A@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 615 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 1530 bytes --]

             reply	other threads:[~2022-06-05  9:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-05  9:12 Sebastian Gniazdowski [this message]
2022-06-05 12:22 ` Sebastian Gniazdowski

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='CAKc7PVAP997mgSrx4hAk5cEKOwXxpia6sKeH0U-LEJSCkoXv=A@mail.gmail.com' \
    --to=sgniazdowski@gmail.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).