What you want is the index of the Regex matches.
If you perform the Regex as follows:
var reg = /\{{(.*?)\}}/g; // The Regex selector
while(match=reg.exec(sentence)) { // Iterate all the matched strings
// match.index gives the starting position of the matched string
// match.length gives the length of the matched string, number of characters
}
You will get the position and length of all the matches which can be used for selection. The while loop iterates all the matches.
Save the matches and user their index and length values to select them one by one.
Edit Back again. As you probably have experienced, selecting text in javascript is not the easiest task but it is completely doable.
I put together a small JSFiddle to demonstrate the technique I used to get the correct result. You can find it here. I hope it's kind of clear and I tried to comment it well.
Of course, if you have any question, just ask!
Cheers!