From: mark Date: 2003-10-09T00:14:52+09:00 Subject: Re: usage of Regexp::EXTENDED Simon Strandgaard wrote: > Feeding the same string into // and into Regexp.new, > yields to different results. A bit inconsist.. > > > def test_option_extended3 > # ignoring newline > re = Regexp.new("b\nc", Regexp::EXTENDED) > assert_match(re, "abcd") > end In this case the \n will have already been replaced by a literal newline. So Regexp.new receives "a b" as it's first parameter. > def test_option_extended4 > # does not ignore newline... makes no sense? > assert_no_match(/b\nc/, "abcd") > end > In this case the \n won't have been interpolated before constructing the regexp. Best Regards Mark Sparshatt