From: "ara.t.howard" Date: 2007-10-27T11:33:43+09:00 Subject: Re: Newlines included in bracket negation On Oct 26, 2007, at 3:30 PM, Chris Morris wrote: > Adding \n inside the brackets fixes it, I just wouldn't expect to > have to do > this since I didn't add the multiline mode option. > > require 'test/unit' > > class TestRE < Test::Unit::TestCase > def test_newlines > src = "happy\n\nbirthday" > assert_equal("hday", src.scan(/h[^x\n]*?day/).to_s) > end > end from memory, 'multiline' affects *only* the behavior of '.' in res the re [^x] => 'not x' simply matches any char that is not 'x' - including newline it's the same in perl and python iirc cheers. a @ http://codeforpeople.com/ -- we can deny everything, except that we have the possibility of being better. simply reflect on that. h.h. the 14th dalai lama