title: How to extract a json value substring with jq
body: <p>I have this json: </p>
  
  <pre><code>{"temperature":"21", "humidity":"12.3", "message":"Today ID 342 is running"}
  </code></pre>
  
  <p>I want to use jq to obtain this json:</p>
  
  <pre><code>{"temp":"21", "hum":"12.3", "id":"342"}
  </code></pre>
  
  <p>As you can see, what i want to do is extract the ID number 342 and put it in the new json with a different key name. I think i should use a regex but i don't know how to insert it in jq syntax.</p>
  
  <p>I can create another json using the basic command:</p>
  
  <pre><code>cat old.json | jq '{temp:.temperature,hum:.humidity, id:.message}' &gt; new.json
  </code></pre>
  
  <p>I know i can select substring using square brackets, but i don't want to use them because they don't take into account strings with different lengths and structure. I want to use a regex because i know that the ID number comes lways after the "ID" part.</p>