function check()
{
var s = " I love you 9 6 66";
var re = /([ ]{4,})/g;
var r = s.replace(re," SupperSdr");
alert(r);
}
check();
将s中出现的空格全部用SupperSdr这个字符串代替