title: VBscript regex replace
body: <p>I have no idea why this is only applying to the last instance found, not all of them as I would expect.  Any help appreciated.</p>
  
  <p><strong>Input string:</strong></p>
  
  <pre><code>&lt;a href="http://www.scirra.com" target="_blank" rel="nofollow"&gt;http://www.scirra.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;a href="http://www.scirra.com" target="_blank" rel="nofollow"&gt;http://www.scirra.com&lt;/a&gt;&lt;br /&gt;&lt;hr&gt;
  </code></pre>
  
  <p><strong>Regex:</strong></p>
  
  <pre><code>'SEO scirra links
  Dim regEx
  Set regEx = New RegExp
  
  ' BB code urls
  With regEx
      .Pattern = "&lt;a href=\""http://www.scirra.com([^\]]+)\"" target=\""_blank\"" rel=\""nofollow\""&gt;"
      .IgnoreCase = True
      .Global = True
      .MultiLine = True
  End With
  strMessage = regEx.Replace(strMessage, "&lt;a href=""http://www.scirra.com$1"" target=""_blank"" title=""Some value insert here""&gt;")
  
  set regEx = nothing
  </code></pre>
  
  <p><strong>Output:</strong></p>
  
  <pre><code>&lt;a href="http://www.scirra.com" target="_blank" rel="nofollow"&gt;http://www.scirra.com&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
  &lt;a href="http://www.scirra.com" target="_blank" title="Some value insert here"&gt;http://www.scirra.com&lt;/a&gt;&lt;br /&gt;&lt;hr&gt;
  </code></pre>
  
  <p>Can anyone shed light on why it's only adding the title to the last found instance? (I've tested with more, always just applies to last one)</p>