https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#specifying_a_function_as_a_parameter Depends on strongly typing anonymous groups: https://github.com/danielroe/magic-regexp/issues/24