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

Re: Bug in filename expansion



> >ls zz*
> zzayy  zzbyy  zzxyy
> 
> >ls zz(a|b)yy
> zzayy  zzbyy
> 
> >ls zz^(a|b)yy
> zsh: no match
>  
> Seems wrong.
[...]
> But the 3rd command should give me the files that start with "zz", then have
> a character OTHER than "a" or "b", and end with "yy".
> It should give me "zzxyy", but it doesn't.

No, it isn't wrong.  ^pattern matches if pattern does not match.  You should
use groupping.

zz^(a|b)yy is the same as zz^((a|b)yy) and zz(^(a|b))yy is what you want.

Zoltan




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