title: regex on nested object key to filter list python
body: <p>I have an array of objects like below:</p>
  <pre class="lang-py prettyprint-override"><code>my_objects = [
      {&quot;id&quot;: 1, &quot;labels&quot;: {&quot;abc&quot;: &quot;123&quot;}},
      {&quot;id&quot;: 2, &quot;labels&quot;: {&quot;prefix-abc&quot;: &quot;123&quot;}},  
      {&quot;id&quot;: 3, &quot;labels&quot;: {&quot;prefix-abc&quot;: &quot;123&quot;}},  
      {&quot;id&quot;: 4, &quot;labels&quot;: {&quot;xyz-abc&quot;: &quot;123&quot;}},  
  ]
  </code></pre>
  <p>I want to be able to filter down to objects that don't have a key in labels that match <code>prefix-</code>.</p>
  <p>What I'd end up with is:</p>
  <pre class="lang-py prettyprint-override"><code>filtered = [
      {&quot;id&quot;: 1, &quot;labels&quot;: {&quot;abc&quot;: &quot;123&quot;}}, 
      {&quot;id&quot;: 4, &quot;labels&quot;: {&quot;xyz-abc&quot;: &quot;123&quot;}},  
  ]
  </code></pre>
  <p>At the moment I have a working solution but not sure if its the most efficient:</p>
  <pre class="lang-py prettyprint-override"><code>for thing in my_objects:
      labels = thing.get(&quot;labels&quot;, {})
      for key in labels.keys():
          if &quot;prefix-&quot; in key:
               # handle
  </code></pre>