nl_tokens: Finds the last index based on a regex match
pl_tokens: function lastIndexOfMatch ( <mask> , 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 ; }