str = str.slice(0, 9) + "привет" + str.slice(89)
var str='1234567890'; alert(str.replace(/([.\s\S]{4})[.\s\S]{3}([.\s\S]*)/g,'$1привет$2'));
String.prototype.splice = function (start, count, elems) { var arr = this.split(''); arr.splice.apply(arr, arguments); return arr.join(''); };