Re: regular expression gurus--help!

I think the code below could be improved, but try using StringScanner.

require “strscan”
s=“abcdefgh”
ss = StringScanner.new(s)

until ss.eos?
 a=ss.scan(/[a-z]{3}/)
 puts a
 ss.pos=ss.pos()-2 unless ss.eos?
end

output:

abc
bcd
cde
def
efg
fgh