Bug #1639: YAML.load fails on some Regexps
http://redmine.ruby-lang.org/issues/show/1639

Author: viktor tron
Status: Open, Priority: Normal
ruby -v: ruby 1.8.7 (2008-08-11 patchlevel 72) [i486-linux]

lib/yaml/rubytypes.rb

>> Regexp.new('',0,'u')
=> //u
>> YAML.dump(Regexp.new('',0,'u'))
=> "--- !ruby/regexp //u\n"
>>  YAML.load(YAML.dump(Regexp.new('',0,'u')))
YAML::TypeError: Invalid Regular expression: "//u"
        from /usr/lib/ruby/1.8/yaml/rubytypes.rb:275:in `yaml_new'
        from /usr/lib/ruby/1.8/yaml.rb:133:in `transfer'
        from /usr/lib/ruby/1.8/yaml.rb:133:in `node_import'
        from /usr/lib/ruby/1.8/yaml.rb:133:in `load'
        from /usr/lib/ruby/1.8/yaml.rb:133:in `load'
        from (irb):30
        from :0


----------------------------------------
http://redmine.ruby-lang.org