Reverting back to re.match for key checking.