On Tue, 2003-06-24 at 10:10, Patrick Zesar wrote: > > 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. > > thanx - that's perfect > > i wasn't aware of the '?:'-thing - i'm still not sure what it does exactly - > but it's working ;-)) (?: ... ) is "group without capture" -- it's the same grouping effect as ( ... ), but it doesn't affect $1, $2, etcetera. Ari