From: "tenderlovemaking (Aaron Patterson)" Date: 2012-03-27T02:20:44+09:00 Subject: [ruby-core:43701] [ruby-trunk - Bug #6205][Closed] YAML Regexp in anchor gets converted to String Issue #6205 has been updated by tenderlovemaking (Aaron Patterson). Status changed from Open to Closed Assignee set to tenderlovemaking (Aaron Patterson) % Done changed from 0 to 100 Thanks for the bug report! This was fixed in r33679. I'll make a request to backport the fix to the 1.9.3 branch. ---------------------------------------- Bug #6205: YAML Regexp in anchor gets converted to String https://bugs.ruby-lang.org/issues/6205#change-25201 Author: giddie (Paul Dann) Status: Closed Priority: Normal Assignee: tenderlovemaking (Aaron Patterson) Category: Target version: ruby -v: ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-linux] I'll try to illustrate with code: YAML: --- hello: &allow-float !ruby/regexp '/hello/' bla: *allow-float RUBY: require 'yaml' config = YAML.load_file('config.yaml') puts config.inspect puts config['hello'].class puts config['bla'].class OUTPUT: {"hello"=>/hello/, "bla"=>"/hello/"} Regexp String The Regexp has become a string. This only seems to happen if the Regexp is at the root of the anchor. This happens with Ruby 1.9.3p0, but not with 1.9.2p290. -- http://bugs.ruby-lang.org/