1var str = "I learned to play the Ukulele in Lebanon."
2var regex = /le/gi, result, indices = [];
3while ( (result = regex.exec(str)) ) {
4 indices.push(result.index);
5}
6console.log(indices) // => [2, 25, 27, 33]
7//find all occurence of le and return the return an array of the indeces