From: dblack@... Date: 2003-10-08T22:03:02+09:00 Subject: Re: usage of Regexp::EXTENDED Hi -- On Wed, 8 Oct 2003, Simon Strandgaard wrote: > On Wed, 08 Oct 2003 21:58:42 +0900, Jim Weirich wrote: > > > On Wed, 2003-10-08 at 07:48, Simon Strandgaard wrote: > >> How does it work ? > >> > >> > >> I tried > >> assert_match(/bc/x, "ab cd") > >> But it fails... > > > > Try: assert_match(/b c/x, "abcd") > > that works.. but > > assert_match(/b \nc/x, "abcd") > > fails ? > > programming-ruby says that newlines will be ignored? I think it's only literal newlines -- so that if you want to actually match a newline, there's still a way to do it. (And since the idea behind /x is to increase whitespace and readability, there's not much advantage skipping over "\n" :-) Here's an example with a literal newline: irb(main):003:0> /a irb(main):004:0/ b/x.match("ab") => # David -- David Alan Black home: dblack@superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav