code: function replace(src, token, value) {
      var idx = src.indexOf(token);
      if (idx == -1) {
          return;
      }
      return src.substr(0, idx) + value + src.substr(idx + token.length);
  }
docs: use this to avoid str.replace do the trick on $&, $` https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace