From: Chris Morris Date: 2007-10-27T06:12:46+09:00 Subject: Newlines included in bracket negation ------=_Part_4484_1580761.1193433148224 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline (... that subject probably makes no sense ...) Anyway, I have some unexpected (to me) behavior in the following regexp. This example is contrived, but based on a real need. Can anyone explain why the result is multi-line, even though the re is not? require 'test/unit' class TestRE < Test::Unit::TestCase def test_newlines src = "happy\n\nbirthday" assert_equal("hday", src.scan(/h[^x]*?day/).to_s) end end produces Finished in 0.031 seconds. 1) Failure: test_newlines_consumed_in_not_section(TestRE) ... <"hday"> expected but was <"happy\n\nbirthday">. -- Chris http://clabs.org ------=_Part_4484_1580761.1193433148224--