title: Perl multiline regex
body: <p>I have a file full of json objects to parse, similar to this one:</p>
  
  <pre><code>{
  "_id" : ObjectId("523a58c1e4b09611f4c58a66"),
  "_items" : [
      {
          "adGroupId" : NumberLong(1230610621),
          "keywordId" : NumberLong("5458816773")
      },
      {
          "adGroupId" : NumberLong(1230613681),
          "keywordId" : NumberLong("3204196588")
      },
      {
          "adGroupId" : NumberLong(1230613681),
          "keywordId" : NumberLong("4340421772")
      },
      {
          "adGroupId" : NumberLong(1230615571),
          "keywordId" : NumberLong("10525630645")
      },
      {
          "adGroupId" : NumberLong(1230617641),
          "keywordId" : NumberLong("4178290208")
      }
  ]}
  </code></pre>
  
  <p>I want to take the numbers from inside de NumberLong(). At first I needed just the keywordId, and managed to accomplish it with:</p>
  
  <pre><code>cat listado.txt |&amp; perl -ne 'print "$1," if /\"keywordId\" : NumberLong\(\"?(\d*)\"?\)/' keywordIds.txt
  </code></pre>
  
  <p>This generated a comma separated file with the numbers. I now need also de adGroupIds, so I'm trying the following matching regex with no luck:</p>
  
  <pre><code>cat ./work/listado.txt |&amp; perl -ne 'print "$1-$2," if /\"adGroupId\" : NumberLong\(\"?(\d*)\"?\),\s*\"keywordId\" : NumberLong\(\"?(\d*)\"?\)/m'
  </code></pre>
  
  <p>The regex matches, but I believe perl is not doing multiline, even though I'm using <code>/m</code>.</p>
  
  <p>Any ideas?</p>