On Thu 15 Feb 2007 at 00:40:09 +0900, Phrogz wrote: > On Feb 14, 8:17 am, Ian Macdonald <i... / caliban.org> wrote: > > As you can see, interactively irb returns nil for that first regex match. > > Aren't you making the assumption that it's the regex at fault here, > and not the encoding of the string when you enter it in irb? > > What if you do: > > gavinkistner$ cat set_foo.rb > $foo = "prñÇñÓñÔ" > > gavinkistner$ irb > irb(main):001:0> load 'set_foo.rb' > => true > irb(main):001:0> $foo =~ /[^[:alnum:]]/ > ??? $ irb irb(main):001:0> load 'foo' => true irb(main):002:0> $foo => "pr\351f\351r\351es" irb(main):003:0> $foo =~ /[^[:alnum:]]/ => nil It's still nil, I'm afraid. Ian -- Ian Macdonald | ..disk or the processor is on fire. ian / caliban.org | http://www.caliban.org/ | | |