dist/marky-marked.js
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;
}
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;
}
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