Syck dies on multiline regex

Discussion in 'Ruby' started by Josh Cheek, Jun 13, 2011.

  1. Josh Cheek

    Josh Cheek Guest

    [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?
     
    Josh Cheek, Jun 13, 2011
    #1
    1. Advertisements

  2. Josh Cheek

    Ryan Davis Guest

    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"
     
    Ryan Davis, Jun 13, 2011
    #2
    1. Advertisements

  3. Josh Cheek

    Guest

    On Mon, Jun 13, 2011 at 3:34 PM, Josh Cheek <> 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=
     
    , Jun 14, 2011
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Yatima

    Multiline regex help

    Yatima, Mar 3, 2005, in forum: Python
    Replies:
    13
    Views:
    733
    Kent Johnson
    Mar 4, 2005
  2. eggie5

    multiline regex expression

    eggie5, Jul 21, 2007, in forum: Java
    Replies:
    4
    Views:
    600
    Roedy Green
    Jul 22, 2007
  3. Gilles Ganault

    [2.5] Regex doesn't support MULTILINE?

    Gilles Ganault, Jul 22, 2007, in forum: Python
    Replies:
    9
    Views:
    415
    Gilles Ganault
    Jul 24, 2007
  4. Replies:
    3
    Views:
    1,096
    Reedick, Andrew
    Jul 1, 2008
  5. Brandon Harris

    Multiline regex

    Brandon Harris, Jul 21, 2010, in forum: Python
    Replies:
    1
    Views:
    374
    Peter Otten
    Jul 21, 2010
  6. Brandon Harris

    Re: Multiline regex

    Brandon Harris, Jul 21, 2010, in forum: Python
    Replies:
    1
    Views:
    406
    Steven D'Aprano
    Jul 22, 2010
  7. Christopher M. Lusardi
    Replies:
    3
    Views:
    367
    Alan J. Flavell
    Oct 19, 2003
  8. dale zhang
    Replies:
    8
    Views:
    663
    Tintin
    Nov 30, 2004
Loading...