From: Emmanuel Touzery Date: 2002-12-03T23:44:50+09:00 Subject: Re: Conditional block operations Emmanuel Touzery wrote: > Shannon Fang wrote: > >> >> I think for this case, the easist way might be >> >> file.each do |line| >> a, b = line.split(pattern) if line !~ /^\s*$/ >> end > > > grep could help, unfortunately I don't know if it can be negated (eg > "all but the matches"). > > emmanuel actually \S is "non whitespace character", so this is ok: file.grep /^\S+$/ do |line| a, b = line.split pattern end emmanuel -- "If someone breaks into my house and steals my CDs, who calls the cops, me or the music industry? If it's me, then that's my property." --Ruben Safir