title: Scala regex replace with anonymous function
body: <p>In Ruby I can replace characters in a string in the following way:</p>
  
  <pre><code>a = "one1two2three"
  a.gsub(/\d+/) {|e| e.to_i + 1}
  =&gt; "one2two3three"
  </code></pre>
  
  <p>The result of evaluating the block from the second line, will replace what was matched in the pattern. Can we do something equivalent in Scala? Replace something in a regex with the results of a function/anonymous function?</p>