Hi,
I'm using Ruby 1.8.6, and I just discovered something rather
interesting, here is a test:
require 'test/unit'
class TestRegexBug < Test::Unit::TestCase
def test_bug
hours = "pon-¥È¹Æt"
assert(hours =~ /[¥È¹¾et/i)
assert(hours =~ /¥È¹Æt/i)
assert(hours =~ /-¥È¹Æt/i)
assert(hours =~ /[c¥È¹¾et/i)
assert(hours =~ /-[¥È¹¾et/i)
end
end
As you can see, this only happens with unicode letters... (the last test
fails).. I'm used to the fact that //i doesn't work for unicode chars
and I already know that you need two dots to match one of these.. But
this problem is different and weirder, because what triggers it is a
minus sign before the square brackets.. if you remove either the '-' or
'[]' from the regex, it works..
Can you comment?
thank you,
david
--
Posted via http://www.ruby-forum.com/.