title: javascript, regex parse string content in curly brackets
body: <p>i am new to regex. I am trying to parse all contents inside curly brackets in a string. I looked up <a href="https://stackoverflow.com/questions/413071/regex-to-get-string-between-curly-braces-i-want-whats-between-the-curly-brace">this post</a> as a reference and did exactly as one of the answers suggest, however the result is unexpected.</p>
  
  <p>Here is what i did</p>
  
  <pre><code>var abc = "test/abcd{string1}test{string2}test" //any string
  var regex = /{(.+?)}/
  regex.exec(abc) // i got ["{string1}", "string1"]
               //where i am expecting ["string1", "string2"]
  </code></pre>
  
  <p>i think i am missing something, what am i doing wrong?</p>
  
  <p><strong>update</strong></p>
  
  <p>i was able to get it with <code>/g</code> for a global search</p>
  
  <pre><code>var regex = /{(.*?)}/g
  abc.match(regex) //gives ["{string1}", "{string2}"]
  </code></pre>
  
  <p>how can i get the string w/o brackets?</p>