com.mongodb.util.JSON.parse() fails to correctly parse single backslash string

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 2.10.1
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      My test program outputs:

      str print { "timestamp" : { "$regex" : "/\w/"}}
      JSON print { "timestamp" : { "$regex" : "/w/"}}    <= WRONG?
      str print { "timestamp" : { "$regex" : "/\ w/"}}
      JSON print { "timestamp" : { "$regex" : "/\\w/"}}  <= WRONG?
      str print { "timestamp" : { "$regex" : "/\\w/"}}
      JSON print { "timestamp" : { "$regex" : "/\\w/"}}  <= OK
      str print { "timestamp" : { "$regex" : "/\\ w/"}}
      JSON print { "timestamp" : { "$regex" : "/\\ w/"}} <= OK
      

      See https://groups.google.com/forum/?fromgroups=#!topic/mongodb-user/fsrhBwN1SXs for more detail.

            Assignee:
            Unassigned
            Reporter:
            Stephen Lee (Inactive)
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: