From: botp Date: 2010-04-14T07:50:29+09:00 Subject: Re: How to find multiple matches in a string On Wed, Apr 14, 2010 at 1:32 AM, Andrea Dallera wrote: > Nope, tried it. > > -- > Andrea Dallera > http://github.com/bolthar/freightrain > http://usingimho.wordpress.com > > > On Wed, 2010-04-14 at 02:27 +0900, Caleb Clausen wrote: >> s = 'abcde_abcde_abcde' >>   i=0 >>   while i=s.index('b',i) >>      do_something_with i >>   end > what do you mean it does not work? btw, you can also use stringscan. it's fast. > s=StringScanner.new "this is a test string" => # > p s.pos while s.scan_until /s/ 4 7 13 16 => nil pls do not top post. kind regards -botp