From: Daniel Brockman Date: 2005-07-02T10:02:05+09:00 Subject: Re: no clue Joe Van Dyk writes: > attributes = message.split(",") > attributes.each do |attribute| > key, value = attribute.scan(/(\w+): (.+)/)[0] > result_hash[key.to_sym] = value.strip > end How about this? message.scan /(\w+)\s*:\s*([^, ]*)/ do |k, v| result_hash[k.to_sym] = v end > Also, this will get ran potentially thousands of times per second, > so executation speed is of some concern. I don't know if the above is the best you can do, but I do believe it is a bit faster than your original version. -- Daniel Brockman