Use regex.exec() instead of string.match()