title: Javascript regex - how to get text between curly brackets
body: <p>I need to get the text (if any) between curly brackets. I did find this other post but technically it wasn't answered correctly:
  <a href="https://stackoverflow.com/questions/2403678/regular-expression-to-extract-text-between-either-square-or-curly-brackets">Regular expression to extract text between either square or curly brackets</a></p>
  
  <p>It didn't actually say how to actually extract the text. So I have got this far:</p>
  
  <pre><code>var cleanStr = "Some random {stuff} here";
  var checkSep = "\{.*?\}"; 
  if (cleanStr.search(checkSep)==-1) { //if match failed
    alert("nothing found between brackets");
  } else {
    alert("something found between brackets");
  }
  </code></pre>
  
  <p>How do I then extract 'stuff' from the string? And also if I take this further, how do I extract 'stuff' and 'sentence' from this string:</p>
  
  <pre><code>var cleanStr2 = "Some random {stuff} in this {sentence}";
  </code></pre>
  
  <p>Cheers!</p>