title: Is there something like PHP's preg_replace_callback() in javascript?
body: <p>What I want to do is <code>str.replace(pattern, callback)</code>,</p>
  
  <p>not simply <code>str.replace(pattern, replace_pattern)</code>,</p>
  
  <p>is it possible to do it in javascript?</p>