docs: function getAllMatchAndRange(regex, string) {
    if (!regex.global) {
      return [];
    }
  
    let resultArray = [];
    regex.lastIndex = 0;
    let result = regex.exec(string);
    while (result !== null) {
      resultArray.push([result[0], result.index, regex.lastIndex]);
      result = regex.exec(string);
    }
    return resultArray;
  }