Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[[ 'abcde' =~ (#i)Bcd ]]
- X-seq: zsh-users 28325
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: [[ 'abcde' =~ (#i)Bcd ]]
- Date: Mon, 7 Nov 2022 13:10:40 -0800
- Archived-at: <https://zsh.org/users/28325>
- List-id: <zsh-users.zsh.org>
[[ '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