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

Re: Why approximate pattern doesn't match?



On Tue, May 10, 2016 at 5:56 AM, Bart Schaefer
<schaefer@xxxxxxxxxxxxxxxx> wrote:
> On May 9, 10:11pm, Sebastian Gniazdowski wrote:
> } Subject: Re: Why approximate pattern doesn't match?
> }
> } Hello again,
> } it appears that the approximate matching works only for first word in
> } the *~^* sequence:
> }
> } a=( "git push" )
> } pattern1='git*~^*pash*'
>
> I read that as: git followed by anything, except NOT matching (~)
> anything NOT containing "pash".  Who came up with that double-negative?

I think I sent a mail to the list when I discovered it, the operations
simplify to "AND", which we don't have as a primitive. Eg foo~^bar
means result that match both patterns foo and bar. It is most
obviously useful when the second or first pattern is surrounded by *
so that it means *foo*~^*bar* gives files foobazbar, barbazfoo, barfoo
etc.

-- 
Mikael Magnusson



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