From: Shekar Ls Date: 2009-08-17T13:58:06+09:00 Subject: Re: Reading contents of a file and storing Joel VanderWerf wrote: > Joel VanderWerf wrote: >> Harry Kakueki wrote: >>> h = Hash[*(shellwords(source.gsub("="," ")))] >> >> source.gsub(/^([^=]+)=/) {$1} > > sorry, should be: > > source.gsub(/^([^=]+)=/) {$1 + " "} Hi, Using source.gsub(/^([^=]+)=/) {$1 + " "} gives me the below shown result: url "http://localhost" emailid "User@htmdec.com" password "12345678" browser "iexplore" Since i am new to programming lang, i dont know how to write a regex. I am looking for output like this a = "http://localhost" b = "User@htmdec.com" where a & b are variables i am storing these values into. let me know if i am not clear on this. Cheers -- Posted via http://www.ruby-forum.com/.