From: Me Me Date: 2008-09-18T17:48:11+09:00 Subject: Suggestion for string parsing Hi all, I would like to know if there's a better way to parse a string and assing values to variables; Ex: Client=MPEG-4,390000,700000,24000 I can do line =~ /(\w*)=([0-9A-Za-z -.:]*),([0-9]*),([0-9]*),([0-9]*)/ and var1 = $1 var2 = $2 var3 = $3 var4 = $4 var4 = $5 But I'm sure there's a better way, even considering that the number of parameters can increase and I don't want to write a long regular expression rule, that is hard to read. Thanks a lot for any tips -- Posted via http://www.ruby-forum.com/.