Re: more file filtering (e::), stest, perl (Re: A question about filename generate)

Bart Schaefer <[email protected]>
Newsgroups gmane.comp.shells.zsh.devel,gmane.comp.shells.zsh.user
Message-ID <CAH+w=7bNLFB8tkJyZ+nr0zkAUaL7Vssmuto8rtyViPZ1BzwiEA@mail.gmail.com>
On Mon, Jul 28, 2025 at 8:17 AM Marc Chantreux <[email protected]> wrote:
>
> if you read the 'FILENAME GENERATION' section from zshexpn, you'll see
> that ^x exists, x~y exists but there is no thing such x^y.

Not precisely true, as PWS mentioned.  This could perhaps be clarified
in the manual.  You can append ^y to a pattern but x^y doesn't imply
negation of the entirety of x, rather it means "x followed by anything
not y".  The precedence is also a little confusing; e.g., * has higher
precedence than ^ so

% print configure*
configure configure.ac configure.ac.orig
% print configure*^.orig
configure configure.ac configure.ac.orig
% print configure^*.orig
configure configure.ac

That is, in x^y the x pattern is fully expanded and then must not be
followed by the y pattern.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.