你何不自己試試看呢?
原 post 說他試過了, 不知道 peiga 兄是否試過了?
弟剛剛也很好奇, 試了一下, 竟然和 gerrybbs 結果一樣, 覺得太不合理了.
於是在 man 半天的 grep 之後, 找到下面這段文字 [節引]:
in the default C locale, [a-d] is equivalent to [abcd]. Many locales sort characters in
dictionary order, and in these locales [a-d] is typically not equivalent to [abcd]; it might
be equivalent to [aBbC-cDd]
簡單來說, a-z 這種用法在 locale 為 C 的情況下是正常的, 但是有些 locale 有自己的
字典順序, 因此 [a-z] 的結果 可能不一樣. 弟的 locale 是 zh_TW.Big5 , 結果就不一樣,
改回 C 之後就正常了.
供大家參考, 若有誤請指正