From: "Wolfgang Nádasi-Donner" Date: 2007-10-31T06:08:18+09:00 Subject: Re: regular expressions in utf8? Hadmut Danisch schrieb: > can utf8 characters be used in [] in regular expressions? It should work, and a test shows, that it works. I've used an utf-8 encoded file on Windows for the program, and prepared "out.txt" as utf-8 encoded. >>>>> Program >>>>> s = "hallo ������x������x������x������x���������" puts s.encoding puts s.length puts s.bytesize p s.scan(/[�����������]{2}/) >>>>> Protocol >>>>> C:\Dokumente und Einstellungen\wolfgang\Desktop>ruby19 -v ruby 1.9.0 (2007-10-29 patchlevel 0) [i386-mingw32] C:\Dokumente und Einstellungen\wolfgang\Desktop>ruby19 uniscan.rb 25 43 ["����������", "����������", "������������", "����������", "������������"] C:\Dokumente und Einstellungen\wolfgang\Desktop>ruby19 uniscan.rb >> out.txt C:\Dokumente und Einstellungen\wolfgang\Desktop> >>>>> out.txt >>>>> 25 43 ["����", "����", "����", "����", "������"] >>>>> End of Test >>>>> It does exactly what expected. Wolfgang N��dasi-Donner