add index and input value for regexp.exec result array