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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor - P4
    • Resolution: Done
    • 2.1.0
    • 2.5.0
    • Shell
    • Fully Compatible
    • ALL

    Description

      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

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: