JSFiddle - React, Tailwind, and code Playground
JavaScript
var re = /três/g,
idx = [],
str = "três tigres...";
while ((match = re.exec(str)) != null) {
idx.push(match.index);
}
console.log(idx);
var re = /três/g,
idx = [],
str = "três tigres...";
while ((match = re.exec(str)) != null) {
idx.push(match.index);
}
console.log(idx);