help / color / mirror / code / Atom feed
From: Sebastian Gniazdowski <sgniazdowski@gmail.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: #% anchoring doesn't work with (S)
Date: Mon, 30 Jan 2023 12:32:55 +0000	[thread overview]
Message-ID: <CAKc7PVA=Beup8-GyjpxCst0=Ne_-v1yjYqn46YuRMTRuvTpteg@mail.gmail.com> (raw)

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

INPUT=ABC; INPUT=${(S)INPUT//#%((#b)(*))/°match°}; print $match
#no output

# Try to quote #
INPUT=ABC; INPUT=${(S)INPUT//\#\%((#b)(*))/°match°}; print $match
#no output

# Anchor with (#s)/(#e) instead:
INPUT=ABC; INPUT=${(S)INPUT//(#s)((#b)(*))(#e)/°match°}; print $match
#ouput correct:

# No S-flag
INPUT=ABC; INPUT=${INPUT//#%((#b)(*))/°match°}; print $match
#output correct

BTW, what were the rules of (#b) flag activity (or (#B))? It was something
about "till the end of the parens".

Best regards,
Sebastian Gniazdowski

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

             reply	other threads:[~2023-01-30 12:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-30 12:32 Sebastian Gniazdowski [this message]
2023-02-02  8:31 ` Sebastian Gniazdowski
2023-02-02 10:32   ` Mikael Magnusson
2023-02-02 10:44     ` Mikael Magnusson
2023-02-02 12:47     ` Sebastian Gniazdowski
2023-02-06 17:17       ` Bart Schaefer
2023-02-06 17:31         ` Peter Stephenson
2023-02-02 10:49   ` Peter Stephenson

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAKc7PVA=Beup8-GyjpxCst0=Ne_-v1yjYqn46YuRMTRuvTpteg@mail.gmail.com' \
    --to=sgniazdowski@gmail.com \
    --cc=zsh-workers@zsh.org \


* 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


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).