It can still be defined up in the start of the `forEach` as `var replacer = (function(match){}).bind(this);` --- as it is now, it is inside of a double tight loop and being defined quite a few times :)