From: nobu.nokada@... Date: 2003-06-30T10:03:20+09:00 Subject: Re: Regexp#options (RCR #43) Hi, At Mon, 30 Jun 2003 09:40:48 +0900, Daniel Berger wrote: > # example using longhand > irb(main):001:0> r = > Regexp.new(/\w+/,Regexp::EXTENDED) > (irb):1: warning: flags ignored > => /\w+/ Because you passed a Regexp, which has its own options. irb(main):001:0> r = Regexp.new('\w+', Regexp::EXTENDED) => /\w+/x irb(main):002:0> r.options => 2 > # example using shorthand > irb(main):002:0> r.options > => 0irb(main):003:0> r = /\w+/xi > => /\w+/ix > irb(main):004:0> r.options > => 3 > > My guess is that it's returning length + 1, instead of > the options themselves. If my opinion carries any > weight, I would like r.options (using the last > example) to return ["x","i"]. BIT OR-ed flags. irb(main):003:0> Regexp::EXTENDED => 2 irb(main):004:0> Regexp::IGNORECASE => 1 -- Nobu Nakada