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

Pattern matching operations produces incorrect results when MULTIBYTE is not set



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