whole_func_string: function lastIndexOfMatch(string, regex, index) {
    const str = index !== null ? string.substring(0, index) : string;
    const matches = str.match(regex);
    return matches ? str.lastIndexOf(matches[matches.length - 1]) : -1;
  }
func_code_string: function lastIndexOfMatch(string, regex, index) {
    const str = index !== null ? string.substring(0, index) : string;
    const matches = str.match(regex);
    return matches ? str.lastIndexOf(matches[matches.length - 1]) : -1;
  }
func_documentation_string: Finds the last index based on a regex match
  @param   {RegExp} regex a regex object
  @param   {Number} index optional ending index
  @returns {Number} the index of the match