From: Chris Erdal Date: 2006-07-14T00:45:05+09:00 Subject: Re: Help with a regexp > I've been experimenting with Ruby ... Tuesday, ... I never even noticed! talk about showing your age :-) sorry, I caught the colon at the start of each word - should have been : s = "3:a:23:cat5:sheep" words = [] until s.empty? begin unless digits = s.slice!(/\d+(?=:)/) raise "I can't find an integer followed by a colon" end s.slice!(0) words << s.slice!(0..digits.to_i-1) unless words.last.size >= digits.to_i raise "I ran out of characters; looking for #{digits} characters, #{s.size} left" end rescue RuntimeError => e warn "Looking at #{s.inspect}," warn e.message abort "Words found so far: #{words.inspect}" end end puts "Words found: ", words Goodbye, -- chris