fix regex.exec with subgroup match