Subject: GNUE grep 2.5 のパグ 大名です。 GNU grep ver. 2.5 にはバグがあり,-P -i オプションを使うと, おかしな処理がされてしまうので,ver. 2.6 にバージョンアップした方が よさそうです。  http://savannah.gnu.org/forum/forum.php?forum_id=6249 学生からも,マッチングの結果がおかしい,という情報があり,私も, \w, \W, \s, \S, \d, \D, \n が何にマッチするか試してみましたが, かなり変な結果になります。 講義,演習等で,学生に注意喚起した方がいいかもしれません。 -- 名古屋大学大学院国際開発研究科 国際コミュニケーション専攻 大名 力 (Tsutomu OHNA) -------------------------------------------------------------------------------- Subject: Re: GNUE grep 2.5 のパグ 大名です。 #誤: "GNUE" #正: "GNU" [中略] 私もちゃんと説明できないので,次のページを見てください。  http://savannah.gnu.org/forum/forum.php?forum_id=6249 一部だけ引用します。 -------------------------------------------------------------------------------- ** Bug fixes Character classes would malfunction in multi-byte locales when using grep -i. Examples which would print nothing for LC_ALL=en_US.UTF-8 include: - for ranges, echo Z | grep -i '[a-z]' - for single characters, echo Y | grep -i '[y]' - for character types, echo Y | grep -i '[[:lower:]]' grep -i -o would fail to report some matches; grep -i --color, while not missing any line containing a match, would fail to color some matches. grep would fail to report a match in a multibyte character set other than UTF-8, if another match occurred earlier in the line but started in the middle of a multibyte character. Various bugs in grep -P, caused by expressions such as [^b] or \S matching newlines, were fixed. grep -P also supports the special sequences \Z and \z, and can be combined with the command-line option -z to perform searches on NUL-separated records. -------------------------------------------------------------------------------- -- 名古屋大学大学院国際開発研究科 国際コミュニケーション専攻 大名 力 (Tsutomu OHNA) -------------------------------------------------------------------------------- Subject: Re: GNUE grep 2.5 のパグ 皆さん 大名です。 On 2010/11/22, at 19:12, Tsutomu OHNA wrote: > GNU grep ver. 2.5 にはバグがあり,-P -i オプションを使うと, > おかしな処理がされてしまうので,ver. 2.6 にバージョンアップした方が > よさそうです。 最新版は,2.7 のようです。 http://savannah.gnu.org/forum/forum.php?forum_id=6521 -- 名古屋大学大学院国際開発研究科 国際コミュニケーション専攻 大名 力 (Tsutomu OHNA)