title: Regex only matching once, not for all
body: <p>I have a string I want to match, which has content inside curly brackets I want to parse with regex in Java.</p>
  
  <p>The string looks like:</p>
  
  <pre><code>#{apgarscore} &gt;= 0 &amp;&amp; #{apgarscore} &lt; 4 &amp;&amp; #{apgarcomment} == ''
  </code></pre>
  
  <p>I try to use <code>#\{(.+)\}</code></p>
  
  <p>The result is that it for some reason matches</p>
  
  <pre><code>apgarscore} &gt;= 0 &amp;&amp; #{apgarscore} &lt; 4 &amp;&amp; #{apgarcomment
  </code></pre>
  
  <p>rather than three separate values.</p>
  
  <p>I tested it with <a href="https://regex101.com/" rel="nofollow">here</a> which yields the same result.</p>
  
  <p>Can anyone please help me understand what I need to do differently?</p>