title: Get text between tags using javascript
body: <p>I am trying to get prices from between span tags. I would like to have all prices in an array. I cant seem to get it to work, I am guessing my regex is incorrect. </p>
  
  <p>I am looking for any span tags with the class 'amount', the tag has no other attributes set and only has one class. E.g. <code>&lt;span class="amount"&gt;&amp;pound;9.99&lt;/span&gt;</code></p>
  
  <pre><code>var prices = resp.fragments['data'].match(/&lt;span class=\"amount\"&gt;(.*?)&lt;\/span&gt;/g)
      .map(function(val){
        return val;
  });
  </code></pre>
  
  <p>Output</p>
  
  <p><code>[ '&amp;pound;9.99', '&amp;pound;100.00' ]</code></p>
  
  <p>I am trying to get prices from between span tags. I would like to have all prices in an array. I cant seem to get it to work, I am guessing my regex is incorrect. </p>
  
  <p>I am looking for any span tags with the class 'amount', the tag has no other attributes set and only has one class. E.g. <code>&lt;span class="amount"&gt;&amp;pound;9.99&lt;/span&gt;</code></p>
  
  <pre><code>var prices = resp.fragments['data'].match(/&lt;span class=\"amount\"&gt;(.*?)&lt;\/span&gt;/g)
      .map(function(val){
        return val;
  });
  </code></pre>
  
  <p>Output</p>
  
  <p><code>[ '&amp;pound;9.99', '&amp;pound;100.00' ]</code></p>
  
  <p><strong>* UPDATE *</strong></p>
  
  <p>Turns out it was an encoding with the ajax response <code>resp.fragments['data']</code>.</p>
  
  <p>I was using regex as it is something I have not really used before in JS and thought I would have a play. I did look at many examples and after about 45 mins with no success I thought a fresh set of eyes would fix it.</p>
  
  <p>@spaceman 
  Thanks for the helpful comment. Your one of those people if someone asked "Is there is a doctor in the house?", you would stand up and say "Sweet load there are loads of doctors out there".</p>