From: "giddie (Paul Dann)" Date: 2012-03-26T20:43:41+09:00 Subject: [ruby-core:43681] [ruby-trunk - Bug #6205][Open] YAML Regexp in anchor gets converted to String Issue #6205 has been reported by giddie (Paul Dann). ---------------------------------------- Bug #6205: YAML Regexp in anchor gets converted to String https://bugs.ruby-lang.org/issues/6205 Author: giddie (Paul Dann) Status: Open Priority: Normal Assignee: 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/