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

[[ 'abcde' =~ (#i)Bcd ]]




[[ 'abcde' =~ 'bcd' ]] && echo match1
[[ 'abcde' = (#i)ABcde ]] && echo match2
[[ 'abcde' =~ (#i)Bcd ]] && echo match3
[[ 'bcd' =~ 'abcde' ]] && echo match4

... I get match 1 and match 2.  I  understand not getting match 4 because '=~' is not bi-directional, the latter value must be a subset of the former.  But why don't I get match 3? It seems to break no rules to make 'Bcd' case insensitive and then find it within 'abcde'.  Is there a workaround?





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