From: brabuhr@... Date: 2011-06-14T09:49:52+09:00 Subject: Re: Syck dies on multiline regex On Mon, Jun 13, 2011 at 3:34 PM, Josh Cheek wrote: > # >> # > > Is this a bug? Probably. > If so, where should I report it? http://redmine.ruby-lang.org/ Though, as noted, syck is not maintained and psych appears to be the future. I have no idea what else I broke :-), but this change runs your sample: $ ruby -v -S irb ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] >> require 'yaml' => true >> [YAML, Marshal].each do |serializer| ?> [/ab/x, /a b/x].each do |regex| ?> begin ?> serializer.load(serializer.dump regex) >> rescue >> p $! >> end >> end >> end => [YAML, Marshal] --- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml/rubytypes.rb.orig 2011-06-13 20:45:05.000000000 -0400 +++ /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/yaml/rubytypes.rb 2011-06-13 20:43:20.000000000 -0400 @@ -253,7 +253,7 @@ class Regexp yaml_as "tag:ruby.yaml.org,2002:regexp" def Regexp.yaml_new( klass, tag, val ) - if String === val and val =~ /^\/(.*)\/([mix]*)$/ + if String === val and val =~ /^\/(.*)\/([mix]*)$/m val = { 'regexp' => $1, 'mods' => $2 } end if Hash === val