Fixed typo, changed mac.replace to use regex instead