title: Replace all strings that begin with some prefix
body: <p>I have a string in the following format:</p>
  
  <pre><code>str = "1:20 2:25 3:0.432 2:-17 10:12"
  </code></pre>
  
  <p>I want for example to replace all strings the begin with <code>"2:"</code> to <code>"2:0"</code>, thus to have:</p>
  
  <pre><code>str = "1:20 2:0 3:0.432 2:0 10:12"
  </code></pre>
  
  <p>The <code>replace</code> function does not suffice since it will result in</p>
  
  <pre><code>str.replace("2:", "2:0") = "1:20 2:025 3:0.432 2:0-17 10:12"
  </code></pre>
  
  <p>Is there a Python function for that?</p>