title: Use jq to filter json with regex, and the rest objects split into two separate chunks, containing half of the remaining objects each
body: <p>Given the following json:    </p>
  
  <pre><code>[{
          "_id": {
              "productno": "5d538a"
          },
          "serial": "15947",
          "description": "text"
      },
      {
          "_id": {
              "productno": "5d587"
          },
          "serial": "15948",
          "description": "text"
      },
      {
          "_id": {
              "productno": "5d5c38c"
          },
          "serial": "15949",
          "description": "more text"
      },{
          "_id": {
              "productno": "5d5c38c"
          },
          "serial": "15967",
          "description": "more text"
      }
  ]
  </code></pre>
  
  <p>i need to filter based on a list of numbers, say for our example</p>
  
  <pre><code>15947
  15948
  </code></pre>
  
  <p>(i have a list of thousands of serials numbers, that are separated by the newline)
  I have tried with </p>
  
  <pre><code>map(select(test("\\^15947$|^15948$\\b")))
  </code></pre>
  
  <p>expected output:
  file A:</p>
  
  <pre><code>{
    "_id": {
      "productno": "5d538a"
    },
    "serial": "15947",
    "description": "text"
  }
  {
    "_id": {
      "productno": "5d587"
    },
    "serial": "15948",
    "description": "text"
  }
  </code></pre>
  
  <p>and file B: (since there are two more objects, each file will have one object)</p>
  
  <pre><code>{
    "_id": {
      "productno": "5d5c38c"
    },
    "serial": "15949",
    "description": "more text"
  }
  </code></pre>
  
  <p>and finally file C:</p>
  
  <pre><code>{
    "_id": {
      "productno": "5d5c38c"
    },
    "serial": "15967",
    "description": "more text"
  }
  </code></pre>