title: reformatting data received from api callback string
body: <p>I am receiving from a php/curl callback to an api and using jquery if statements to output certain data.</p>
  
  <p>For one particular call back string the data is returned like so:</p>
  
  <pre><code>response.endpoints[0].details.cert.subject
  </code></pre>
  
  <p>The value of the above string is:</p>
  
  <blockquote>
    <p>CN=www.thawte.com,OU=Infrastructure Operations,2.5.4.5=#130733383938323631,2.5.4.15=#131450726976617465204f7267616e697a6174696f6e,L=Mountain View,ST=California,C=US,O=Thawte, Inc.,1.3.6.1.4.1.311.60.2.1.2=#0c0844656c6177617265,1.3.6.1.4.1.311.60.2.1.3=#13025553</p>
  </blockquote>
  
  <p>What I would like to be able to achieve is extract certain parts of this string instead of displaying the entire value.</p>
  
  <p>The following are fixed values which will always appear but I dont want the rest of the stuff..</p>
  
  <p>How can I seperately extract the following bits:</p>
  
  <ul>
  <li>CN=value</li>
  <li>OU=value</li>
  <li>L=value</li>
  <li>ST=value</li>
  <li>C=value</li>
  </ul>
  
  <p>For example, in my output I want to set a variable to end up with "www.thawte.com" and a seperate variable for the each of the above.</p>