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テ淌淌毋竄ャ竄ャ竄ャ"
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
<Encoding:UTF-8>
25
43
["├├", "├├", "├├", "├├", ""]

C:\Dokumente und Einstellungen\wolfgang\Desktop>ruby19 uniscan.rb >> out.txt

C:\Dokumente und Einstellungen\wolfgang\Desktop>
 >>>>> out.txt >>>>>
<Encoding:UTF-8>
25
43
["", "", "", "", ""]
 >>>>> End of Test >>>>>

It does exactly what expected.

Wolfgang N叩dasi-Donner