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:15:44 +0000 (GMT) [thread overview]
Message-ID: <1692212664.579212.1644236144924@mail2.virginmedia.com> (raw)
In-Reply-To: <1071890479.577225.1644233454174@mail2.virginmedia.com>
Sorry, this just went to Stephane.
pws
> On 07 February 2022 at 11:30 Peter Stephenson <p.w.stephenson@ntlworld.com> wrote:
>
>
> > On 06 February 2022 at 08:42 Stephane Chazelas <stephane@chazelas.org> wrote:
> > $ set -o extendedglob
> > $ a='Stéphane€'
> > $ print -rn -- ${a//(#U)?} | hd
> > 00000000 a9 82 ac |...|
> > 00000003
> >
> > It seems that with (#U) (and here in a locale using UTF-8 as
> > charmap), ? with (#U) matches only on the first byte of
> > multibyte characters. Is that how it's meant to be?
>
> I think what you're hitting is probably, as you suspected, a
> difference between the pattern matching code and the substitution
> code. The underlying pattern matching really is byte by byte,
> but this doesn't force any substitution such as // to behave
> in the same way. As far as I know, the MULTIBYTE option is
> the only higher level consistency measure we have.
>
> 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.
>
> pws
next prev parent reply other threads:[~2022-02-07 12:16 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 [this message]
2022-02-07 12:24 ` Stephane Chazelas
2022-02-07 12:59 ` 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:
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=1692212664.579212.1644236144924@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).