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

Re: man page bug for negative pattern?



2014-09-19 15:50 GMT+02:00 Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx>:
> But if "^" has a higher precedence than "/", then
>
>     "^foo/bar"
>
> will match any files in "." other than "foo/bar"?

I'll match any file named “bar” in any subdirectory of “.” other than “foo”.

Think of “higher precedence” as implicit parentheses (even if these
parentheses wouldn't be valid zsh):

Since “^” has higher precedence, “^foo/bar” means “(^foo)/bar”. If “/”
had higher precedence, it'd mean “^(foo/bar)”, but that's not the
case.

Best regards,

-- 
Jérémie



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