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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.1.0
    • Fix Version/s: 2.5.0
    • Component/s: Shell
    • Labels:
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      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

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

                Dates

                Created:
                Updated:
                Resolved: