title: MongoDB regex grouping
body: <p>I have a collection with a bunch of documents. I want to find within a large string object (an unformatted key/value) and extract data from it.</p>
  
  <p>Is it possible to use something like this:</p>
  
  <pre><code>db.apps.find({config: '/\n\n(.*) = (.*)\n\n?/'})
  </code></pre>
  
  <p>to extract these pair of values?</p>
  
  <p>I'm trying to do this with php, but is getting really slow.</p>
  
  <p>How can I find a clean way to solve it?</p>