From: Ruohao Li Date: 2010-08-20T00:45:31+09:00 Subject: Is this a bug of String#count? $ ruby -v ruby 1.9.1p429 (2010-07-02 revision 28523) [i386-darwin9] $ irb --simple-prompt >> s = "a\u4e00" # \u4e00 is the chinese character for "one" in case you can't read the next line => "a一" >> s.encoding => # >> s.length => 2 >> s.count("^a") => 0 Why the above result is 0 not 1? After all there are 2 characters in the string s. Is this a bug of String#count? Thanks in advance. Ruohao -- Posted via http://www.ruby-forum.com/.