Run a JS regex on text: matches, groups, indexes. Capped input and a time budget stops catastrophic backtracking.