From: Chintan Trivedi Date: 2005-12-21T20:31:08+09:00 Subject: Re: Multibyte regexps... --0-400813578-1135164656=:75970 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit l =~ /s/ ?? It will try to find a char "s" in string l and not the value remained in variable s. Horacio Sanson wrote: I am having some issues with regular expressions when working with japanese strings. Using ruby-1.8.3 on Windows XP home (Japanese version) I have this test: irb(main):271:0> s = "鞄" => "\212\223" irb(main):272:0> l = "行" => "\215s" irb(main):273:0> l =~ /s/ => 1 irb(main):274:0> puts "#{$`}<<#{$&}>>#{$'}" E> => nil irb(main):275:0> "#{$`}<<#{$&}>>#{$'}" => "\215<>" irb(main):276:0> s =~ /l/ => nil As you can see comparing two totally different characters (kanji) gives me a match. Reversing the match gives nil. How can I get ruby to match things correctly?? regards, Horacio __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com --0-400813578-1135164656=:75970--