D
D. Krmpotic
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-Äet"
assert(hours =~ /[Ä]et/i)
assert(hours =~ /Äet/i)
assert(hours =~ /-Äet/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
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-Äet"
assert(hours =~ /[Ä]et/i)
assert(hours =~ /Äet/i)
assert(hours =~ /-Äet/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