From: Harry Kakueki Date: 2009-07-18T21:31:53+09:00 Subject: Re: Re-post: Parsing Japanese Language and Some Ruby Trivia > Essentially what we are trying to accomplish is to get a count of every > time one of the hiragana characters occurs adjacent to another hiragana > character (including itself) within the context of a word. > I'm not sure what you want if there are more than 2 hiragana. For example, this "らしつづける" or this ["ら", "し"] ["し", "つ"] ["つ", "づ"] ["づ", "け"] ["け", "る"] Don't trust this too much. I'm just playing around a bit. Maybe it will give you some ideas. $KCODE = 'u' p str.scan(/[あ-ん]{2,}/) OR require 'enumerator' $KCODE = 'u' str.scan(/[あ-ん]{2,}/).each {|x| x.split(//).each_cons(2){|a| p a}} Harry -- A Look into Japanese Ruby List in English http://www.kakueki.com/ruby/list.html