Small error correction

fixed an error for accessing the wrong match for a regex.