2000-07-15 バイナリファイルから文字列を読み取る ruby file a = File.open('xxx.jpg').binmode.read() p a.scan(/(\w{4,})\0/) # 4文字未満はゴミとして捨てる