Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-5697

Unmatched quotes in regular expression cause JS shell to enter multi-line mode

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.0
    • Affects Version/s: 2.1.0
    • Component/s: Shell
    • Fully Compatible
    • ALL

      To reproduce: (in the JS shell)
      > db.test.save({_id:1, name:"O'Reilly"})
      > db.test.find(

      {name:/O'Reilly/}

      )
      ...
      Notice that shell enters multi-line mode. Tad says that, "The isBalanced() routine sees the apostrophe/single-quote and scans looking for a matching quote. When it doesn't find one, it goes into multi-line mode. "

      A question regarding this was asked on Google Groups: http://groups.google.com/group/mongodb-user/browse_thread/thread/fcd29bf712e49e13

            Assignee:
            tad Tad Marshall
            Reporter:
            barrie Barrie Segal
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: