JSFiddle - React, Tailwind, and code Playground

by Brunno Romero

JavaScript

var re = /três/g,
		idx = [],
    str = "três tigres...";
    
while ((match = re.exec(str)) != null) {
    idx.push(match.index);
}

console.log(idx);