var myString = "{0} Hello World {1}"
var splits = myString.split(/\s?{\d}\s?/);
which would return ["", "Hello World", ""],
var count = 0;
for (var i=0; i< splits.length; i++) {
if (splits[i] === "") {
splits[i] = "{" + count + "}";
count++;
}
}
now splits would have what you need.