From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: How to repel a space separated quoted strings with ~?
Date: Sun, 5 Jun 2022 14:22:44 +0200 [thread overview]
Message-ID: <CAKc7PVA1kOGUp1tNF1R0Ku4JfwvUONzWtwFmD5sZ_G=FY_DeLw@mail.gmail.com> (raw)
In-Reply-To: <CAKc7PVAP997mgSrx4hAk5cEKOwXxpia6sKeH0U-LEJSCkoXv=A@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 982 bytes --]
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żytkownik Sebastian Gniazdowski <
sgniazdowski@gmail.com> napisał:
> 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: 2052 bytes --]
prev parent reply other threads:[~2022-06-05 12:23 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-05 9:12 Sebastian Gniazdowski
2022-06-05 12:22 ` Sebastian Gniazdowski [this message]
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='CAKc7PVA1kOGUp1tNF1R0Ku4JfwvUONzWtwFmD5sZ_G=FY_DeLw@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).