From: bwv549 Date: 2007-07-24T06:29:59+09:00 Subject: Re: finding positions in a string > require 'enumerator' > def substring_positions(substring, string) > string.enum_for(:scan, substring).map { $~.offset(0)[0] } > end That's the one-line magic I knew was hiding out there. I will use it and see if it is acceptably fast. Thanks