From: timr Date: 2009-08-28T23:55:12+09:00 Subject: Re: I need a string#all_indices method--is there such a thing? > What about > class String >   def indices rgx, idx=0 >     [].tap{ |r| >       loop do >         idx = index rgx, idx >         break unless idx >         r << idx >         idx += 1 >       end >     } >   end > end > [].tap? you must have defined a tap method for array somewhere. But not in the code you showed. Can't run the code without a definition for tap. Thanks, Tim