Robert Klemme wrote: > > +1 > > "Simon Strandgaard" <neoneye / adslhome.dk> schrieb im Newsbeitrag > news:20040602230945.768b8989.neoneye / adslhome.dk... > > Regexp.new is old, and relies on C'ish magic values. > > > > Lets write something ugly with the current initialize: > > Regexp.new('a.*a', 5, 'U') > > Thats the same as /a.*a/uxim Robert, +1 ?? if we calculate the flags for 'uxim' then 'u' => 64, 'x' => 2, 'i' => 1, 'm' => 4 .... sum=71 > > The problem is these legacy values > > Regexp::IGNORECASE = 1 > > Regexp::EXTENDED = 2 > > Regexp::MULTILINE = 4 > > > > I propose to let initialize take a hash. > > > > Regexp.new('a.*a', :ignorecase=>true, :extended=>true, :multiline=>true, > :encoding=>:UTF8) > > > > > > Ideas for other options: :interpret_warnings_as_errors, :verbose_mismatch -- Simon Strandgaard