Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Matching delimiters for the "e" glob qualifier



2019-08-18 14:55:09 -0500, Bart Schaefer:
> On Sun, Aug 18, 2019, 1:59 PM Stephane Chazelas <stephane.chazelas@xxxxxxxxx>
> wrote:
> 
> > Are we guaranteed it will stay that way?
> >
> 
> Yes.

Thanks. I found that it also works for [...] (which is probably
the one I'll settle on for my own use) and the extended glob
ones (#, ^, ~, the latter only with #q when using extendedglob),
but also "-"!

Which harks back to 
https://www.zsh.org/mla/workers/2019/msg00465.html

Which was also asking (among other things) about the special
treatment of "-" in

$ string=- pattern='\-'; [[ $string = $~pattern ]] && echo yes
yes

(I had no feedback on that one at the time).

Here maybe zsh could extend it to all characters as doing it for
only *?[]^~#- and not others (I've not tested all possible ones)
seems a bit arbitrary.


> $ (echo a(eé'echo é'é)) |& sed -n l
> > zsh: unknown file attribute: ^\003$
> >
> 
> You can't use multibyte characters as the delimiter there.
[...]

Sorry for causing confusion there. UTF-8 é as delimiter is fine
there.

$ zsh -c 'echo /(eé"echo x"é/)'
x
/

The issue I wanted to raise was the bogus error message when
using é as a glob qualifier. It can be reproduced without the
"e" qualifier:

$ zsh -c 'echo /(é)' |& sed -n l
zsh:1: unknown file attribute: ^\003$

-- 
Stephane



Messages sorted by: Reverse Date, Date, Thread, Author