title: Extract JSON value in Bash
body: <p>In the Bash I saved response data into a variable.</p>
  
  <p>The result looks like this:</p>
  
  <pre><code>{"token_type":"Bearer","access_token":"022-8baa5324-f57b-445d-c5ec-821c63a5fd35","expires_in":3600,"scope":"any-website.com"}
  </code></pre>
  
  <p>Now I want to extract the value of the access token into an other var.</p>
  
  <p>In Linux I solved that in this way and it works:</p>
  
  <pre><code>echo "$response_json" | grep -oP '(?&lt;="access_token":")[^"]*'
  </code></pre>
  
  <p>As result I get:</p>
  
  <pre><code>022-8baa5324-f57b-445d-c5ec-821c63a5fd35
  </code></pre>
  
  <p>My problem is that MacOS does not support the grep parameter <code>P</code> (Perl expression) anymore. Parameter <code>E</code> does not work with that expression.</p>
  
  <p>I would appreciate any help with a solution without requiring to install additional Bash tools.</p>