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

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*'
pattern2='pash*~^*git*'
echo "${(@M)a:#(#ia2)*$~pattern1*}"
-> [nothing]
echo "${(@M)a:#(#ia2)*$~pattern2*}"
-> git push

Any solution?

Best regards,
Sebastian Gniazdowski


On 9 May 2016 at 22:07, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
> Hello,
>
> a=( "git commit amend" )
> pattern1='git*~^*comit*~^*amend'
> pattern2='git*~^*commit*~^*amend'
> echo "${(@M)a:#(#ia2)*$~pattern1*}"
> -> [nothing]
> echo "${(@M)a:#(#ia2)*$~pattern2*}"
> -> git commit amend
>
> Does somebody know why a2 isn't sufficient to match "comit" against "commit" ?
>
> Best regards,
> Sebastian Gniazdowski



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