S
Simon Strandgaard
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
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
Lets write something ugly with the current initialize:
Regexp.new('a.*a', 5, 'U')
Thats the same as /a.*a/uxim
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