From: D T Date: 2003-06-24T05:56:25+09:00 Subject: Re: can't find appropriate regexp --0-1000898625-1056401783=:19843 Content-Type: text/plain; charset=us-ascii Oops, sorry the previous one does not match well the third case. change: p line.scan(/"(?:[^\"]|\\")+"/).collect! {|e| e.sub!(/^"(.*)"$/, '\1')} to: p line.scan(/".+(?!\\)"/).collect! {|e| e.sub!(/^"(.*)"$/, '\1')} # need explanation about /".+(?!\\)"/ ? Now it works for all 3 cases. Dave --------------------------------- Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! --0-1000898625-1056401783=:19843 Content-Type: text/html; charset=us-ascii
Oops, sorry the previous one does not match well the third case.
 
change:
p line.scan(/"(?:[^\"]|\\")+"/).collect! {|e| e.sub!(/^"(.*)"$/, '\1')}
 
to:
p line.scan(/".+(?!\\)"/).collect! {|e| e.sub!(/^"(.*)"$/, '\1')}
 
# need explanation about /".+(?!\\)"/  ?
 
Now it works for all 3 cases.
 
Dave


Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month! --0-1000898625-1056401783=:19843--