title: Problem with multiple matches on same line in simple regular expression
body: <p>I'm having a very basic question about regular expressions. I am trying to match and replace URLs like these:</p>
  
  <pre><code>http://mydomain.com/image/13/imagetitle.html
  </code></pre>
  
  <p>For which I use the following expression:</p>
  
  <pre><code>/mydomain.com(.*)image\/(\d+)\/(.*).html/
  </code></pre>
  
  <p>This pattern works fine mostly, yet it does not work when multiple occurrences appear on the same line. So this works:</p>
  
  <pre><code>This is my own image: http://mydomain.com/image/13/imagetitle.html
  </code></pre>
  
  <p>When including multiple occurrences across lines it works as well:</p>
  
  <pre><code>This is my own image: http://mydomain.com/image/13/imagetitle.html
  Yet I recommend this one as well: image: http://mydomain.com/image/15/imagetitle2.html
  </code></pre>
  
  <p>Both occurrences match and are replaced correctly. However, it only replaces the first match when there are two occurrences on the same line:</p>
  
  <pre><code>This is my own image: http://mydomain.com/image/13/imagetitle.html, yet I recommend this one as well: image: http://mydomain.com/image/15/imagetitle2.html
  </code></pre>
  
  <p>How can I make sure all matches are replaced, regardless of new lines?</p>