From: "RadosÅ‚aw BuÅ‚at" Date: 2009-01-25T08:41:24+09:00 Subject: Re: how to find the position of each match within a string On Sun, Jan 25, 2009 at 12:31 AM, Albert Schlef wrote: >> 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? Yes it does, even if it search fixed-size string. -- Pozdrawiam Rados³aw Bu³at http://radarek.jogger.pl - mój blog