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

RE: Bug in filename expansion



[[ example deleted ]]
> 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
>
No, that doesn't work either.  Also, if my 1st attempt ("zz^(a|b)yy") is
incorrect, this is a surprise, and it should probably be mentioned in the
documentation. Or maybe the precedence of "^" changed ?
If there isn't a bug here (and I think there is), then we need some
further examples of "how to do it".

Also.... how can I do a parenthisised group at the *end* of a pattern?  It 
thinks that this is a "list of qualifiers".


Here's my trial script & output:
 
setopt verbose
touch zzayy
touch zzbyy
touch zzxyy
ls zz*
zzayy
zzbyy
zzxyy
#next works--shows a & b
ls zz(a|b)yy
zzayy
zzbyy
#next doesn't work--should show x
ls zz^(a|b)yy
./try: no match [9]
# zoltan says the above means the same as next
ls zz(^(a|b)yy)
./try: no match [11]
# zoltan says this will show x. but it doesn't
ls zz(^(a|b))yy
./try: no match [13]
unsetopt verbose




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