added the regex function to automatically pull captured groups out of a match object