From: Jim Freeze Date: 2002-05-20T08:01:00+09:00 Subject: Need Multiline Regexp Help Hi: I am trying to collect a set of lines in a string. The line repeat a pattern, so I figured I could do a scan with a multi-line regexp to get what I wanted. But I am having trouble understanding what is happening. Can someone help? irb(main):003:0> s="fred\nhello" "fred\nhello" irb(main):005:0> s.scan(/f.*[^l]/m) ["fred\nhello"] ## I thought [^l] would not match 'l' irb(main):006:0> s.scan(/(f.*)[^l]/m) [["fred\nhell"]] ## Again, why the match of 'll' irb(main):009:0> s.scan(/(f.*)[^lo]/m) [["fred\nh"]] ## Why adding a second char changes the result? irb(main):010:0> s.scan(/(f.*)[^ol]/m) [["fred\nh"]] Thanks -- Jim Freeze If only I had something clever to say for my comment... ~