zsh-workers
 help / color / mirror / code / Atom feed
From: Peter Stephenson <p.w.stephenson@ntlworld.com>
To: zsh workers <zsh-workers@zsh.org>
Subject: Re: clarification on (#U) in pattern matching.
Date: Mon, 7 Feb 2022 12:59:12 +0000 (GMT)	[thread overview]
Message-ID: <884256764.581141.1644238752224@mail2.virginmedia.com> (raw)
In-Reply-To: <1692212664.579212.1644236144924@mail2.virginmedia.com>

On 07 February 2022 at 12:15 Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
> I think there might be a parameter matching flag that you can
> also set that would help.  I'd have to look in more detail.

On examination, no, I don't think there is an option at the parameter level,
as opposed to the pattern match level --- and I appreciate that this
distinction, while clear in the code, isn't likely to be so obvious to a
user staring at shell code, even if parameter substitution and pattern
matching are documented separately. The doc for parameters simplify refers
to the MULTIBYTE option.

There's a limited feature to turn off multibyte counting when calculating
widths for use in padding etc. I suppose in principle that could be extended
for pattern matching, but in practice (at least without a major rewrite) all
it would do is turn off the multibyte option locally --- probably carrying over
into pattern matching, so you'd at least get consistency between the two that
way round.

There isn't a sane way to propagate the (U) flag out of the pattern code
back up into the parameter level.

pws


      parent reply	other threads:[~2022-02-07 12:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-06  8:42 Stephane Chazelas
     [not found] ` <1071890479.577225.1644233454174@mail2.virginmedia.com>
2022-02-07 12:15   ` Peter Stephenson
2022-02-07 12:24     ` Stephane Chazelas
2022-02-07 12:59     ` Peter Stephenson [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=884256764.581141.1644238752224@mail2.virginmedia.com \
    --to=p.w.stephenson@ntlworld.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).