Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Pattern matching operations produces incorrect results when MULTIBYTE is not set
- X-seq: zsh-users 22758
- From: guuu@xxxxxxxxxxx
- To: zsh-users@xxxxxxx
- Subject: Pattern matching operations produces incorrect results when MULTIBYTE is not set
- Date: Fri, 30 Jun 2017 19:35:01 -0700
- Importance: Normal
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
When MULTIBYTE support turned off, all the indexing and counting of pattern
matching operations becomes wrong.
unsetopt MULTIBYTE; a=abcdef
(N) (length of matching fragment) returns length of source string despite of
fragment found or not:
echo ${(N)a#abc} ${(N)a#qwe}
6 6
(B) and (E) (beginning and end of matching fragment) returns length of source
string +1:
echo ${(SB)a#b} ${(SE)a#b}
7 7
Bug is confirmed on current git master version.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author