title: JQ: how can I remove keys based on regex?
body: <p>I would like to remove all keys that start with "hide". Important to note that the keys may be nested at many levels. I'd like to see the answer using a regex, although I recognise that in my example a simple <code>contains</code> would suffice. (I don't know how to do this with <code>contains</code>, either, BTW.)</p>
  
  <p>Input JSON 1:</p>
  
  <pre><code>{
    "a": 1,
    "b": 2,
    "hideA": 3,
    "c": {
      "d": 4,
      "hide4": 5
    }
  }
  </code></pre>
  
  <p>Desired output JSON:</p>
  
  <pre><code>{
    "a": 1,
    "b": 2,
    "c": {
      "d": 4
    }
  }
  </code></pre>
  
  <p>Input JSON 2:</p>
  
  <pre><code>{
    "a": 1,
    "b": 2,
    "hideA": 3,
    "c": {
      "d": 4,
      "hide4": 5
    },
    "e": null,
    "f": "hiya",
    "g": false,
    "h": [{
      "i": 343.232,
      "hide9": "private",
      "so_smart": true
    }]
  }
  </code></pre>
  
  <p>Thanks!</p>