From: Robert Smith Date: 2006-08-02T08:54:00+09:00 Subject: Re: newbie qustion Eric Hodel wrote: > On Aug 1, 2006, at 3:35 PM, Robert Smith wrote: > >> ID_ONETHINGTOO "give me a number" >> if line =~ /^ID* (.*?) = \s* " (.*?) "/x >> #if line =~ /^ \s* " (.*?) " \s* = \s* " (.*?) "/x >> table[ $1 ] = $2 >> end >> } >> >> #puts table["StaplingTitle"] >> p table >> end > > //x just gets confusing. Make your regexp simple: > > table = {} > > File.foreach filename do |line| > next unless line =~ /^ID(\S+) "(.*?)"/ > table[$1] = $2 > end > Thanks for your help eric, I tried what you said but nothing gets stored in the table...and i'm nothing seeing why. do you see it? thanks -- Posted via http://www.ruby-forum.com/.