From: ts Date: 2002-08-26T22:36:45+09:00 Subject: Re: Newbie Regexp question >>>>> "T" == =?ISO-8859-1?Q?Torsten R=FCger?= writes: >> name.sub!(/\$/,"\\\$") It's best to use '' Tpigeon% ruby name = "com.foo.Outer$Inner.class" name.sub!(/\$/, '\\$') p name ^D "com.foo.Outer\\$Inner.class" pigeon% T> line = "option.name = "value 1" "value 2" " Well, you can write pigeon% ruby line = 'option.name = "value 1" "value 2"' if /=(.*)/ =~ line p $1 end if /=/ =~ line p $' end ^D " \"value 1\" \"value 2\"" " \"value 1\" \"value 2\"" pigeon% T> 2 an expession that I could use with split that gets an array [ T> "option.name","value 1" , "value 2"] Well, the problem is that you have space between "" and #split is not really adapted for this You can do pigeon% ruby line = 'option.name = "value 1" "value 2"' if /\A[\w.]+\s*=\s*".*"/ =~ line && array = line.split(/\s*=\s*/, 2) array[1] = array[1].scan(/"([^"]*)"/) array.flatten! else array = [] end p array ^D ["option.name", "value 1", "value 2"] pigeon% Guy Decoux