From: Albert Schlef Date: 2009-01-25T08:31:18+09:00 Subject: Re: how to find the position of each match within a string > You can examine the $~ global MatchData object, in a couple of ways: > > irb(main):003:0> "ello-hello".scan('e') do |match| > irb(main):004:1* p $~.pre_match.size > irb(main):005:1> end > 0 > 6 Interesting. Does that mean that String#scan() converts a String argument to RegExp? -- Posted via http://www.ruby-forum.com/.