title: Multi match in re2 regex for terraform
body: <p>I'm trying to apply regex in something like this, in terraform.</p>
  <pre><code>variable &quot;version&quot; {
     type        = &quot;string&quot;
     default     = https://s3-us-east-1.amazonaws.com/bucket/folder/item-v1.2/item-item2-v1.2.gz
     description = &quot;version&quot;
  }
  
  name = &quot;${replace(var.version, &quot;//&quot;, &quot;&quot;)}&quot;
  </code></pre>
  <p>I just need to replace everything and output only &quot;v1.2&quot; for the name, specifically from the <code>item-v1.2</code> file path. I was thinking of doing something along the lines of</p>
  <pre><code>name = &quot;${replace(var.version, &quot;//&quot;, &quot;&quot;)}&quot;
  </code></pre>
  <p>wherein I replace everything but v1.2.</p>
  <p>Any idea how to do it? Thank you in advance!</p>