From: D T Date: 2003-06-24T06:23:34+09:00 Subject: Re: can't find appropriate regexp --0-624742798-1056403412=:71637 Content-Type: text/plain; charset=us-ascii I got wrong again, finally, I test and test and come out this one: str = <<'EOF' foo "foobar" bar "foo" "bar"; fob "foo \"bar\""; EOF str.each_line{ |line| p line.scan(/"(?:[^\\"]|\\.)+"/).collect! {|e| e.sub!(/^"(.*)"$/, '\1')} } It seems to me that works. Patrick Zesar wrote: ---- start of example-lines ---- foo "foobar"; bar "foo" "bar"; fob "foo \"bar\""; ---- end of example-lines ---- --------------------------------- Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! --0-624742798-1056403412=:71637 Content-Type: text/html; charset=us-ascii
I got wrong again, finally, I test and test and come out this one:
 
str = <<'EOF'
foo "foobar"
bar "foo" "bar";
fob "foo \"bar\"";
EOF
str.each_line{ |line|
  p line.scan(/"(?:[^\\"]|\\.)+"/).collect! {|e| e.sub!(/^"(.*)"$/, '\1')}
}
 
It seems to me that works.


Patrick Zesar <jonnypichler@gmx.net> wrote:
---- start of example-lines ----
foo "foobar";
bar "foo" "bar";
fob "foo \"bar\"";
---- end of example-lines ----



Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month! --0-624742798-1056403412=:71637--