title: Python using result of function for Regular Expression Substitution
body: <p>I have a block of text, and for every regex match, I want to substitute that match with the return value from another function.  The argument to this function is of course the matched text.</p>
  
  <p>I have been having trouble trying to come up with a one pass solution to this problem.  It feels like it should be pretty simple.</p>