Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Syck dies on multiline regex

Reply
Thread Tools

Syck dies on multiline regex

 
 
Josh Cheek
Guest
Posts: n/a
 
      06-13-2011
[Note: parts of this message were removed to make it a legal post.]

require 'yaml'
[YAML, Marshal].each do |serializer|
[/ab/x, /a
b/x].each do |regex|
begin
serializer.load(serializer.dump regex)
rescue
p $!
end
end
end

# >> #<Syck::TypeError: Invalid Regular expression: "/a\n b/x">



This, in tandem with a few other things, cost me about four hours today (and
made me reconsider my decision to become a nonsmoker -.-).

Is this a bug? If so, where should I report it?

 
Reply With Quote
 
 
 
 
Ryan Davis
Guest
Posts: n/a
 
      06-13-2011

On Jun 13, 2011, at 12:34 , Josh Cheek wrote:

> require 'yaml'
> [YAML, Marshal].each do |serializer|
> [/ab/x, /a
> b/x].each do |regex|
> begin
> serializer.load(serializer.dump regex)
> rescue
> p $!
> end
> end
> end
>=20
> # >> #<Syck::TypeError: Invalid Regular expression: "/a\n =

b/x">
>=20
>=20
>=20
> This, in tandem with a few other things, cost me about four hours =

today (and
> made me reconsider my decision to become a nonsmoker -.-).
>=20
> Is this a bug? If so, where should I report it?


It is probably a bug. It _probably_ won't ever get fixed as nobody =
really maintains syck anymore (tho if you come up with a patch, that'd =
certainly help). Try psych if it is possible:

6371 % ruby19 -rpsych -ryaml -e 'p YAML.dump /a
b/x'
"--- !ruby/regexp \"/a\\n b/x\"\n"


 
Reply With Quote
 
 
 
 
brabuhr@gmail.com
Guest
Posts: n/a
 
      06-14-2011
On Mon, Jun 13, 2011 at 3:34 PM, Josh Cheek <(E-Mail Removed)> wrote:
> # >> #<Syck::TypeError: Invalid Regular expression: "/a\n =A0 =A0 =A0 =A0=

=A0 b/x">
>
> 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=
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How make regex that means "contains regex#1 but NOT regex#2" ?? seberino@spawar.navy.mil Python 3 07-01-2008 03:06 PM
multiline regex expression eggie5 Java 4 07-22-2007 02:09 AM
Multiline regex help Yatima Python 13 03-04-2005 02:49 AM
how to define a variable to hold a multiline text input in perl from html multiline textbox dale zhang Perl Misc 8 11-30-2004 06:53 AM
Perl 'system' Creates Program That Dies When First C Program Dies Christopher M. Lusardi Perl Misc 3 10-19-2003 11:53 AM



Advertisments